problem link css stylesheet

doc fluty

New Member
Forgive me, Im basic lol

I have

<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="assets/css/docs.css" rel="stylesheet">

in my html code and it works fine on base level pages.

for example... it works great on www.sample.com

but when i create a subdirectory and create a page like www.sample.com/page1 the css doesn't work.... the page and info is there when i go into the browser... but there is no styling.

Can someone help me?

I tried adding .../ before the assets... but that didnt work.

Any ideas?
 

CaldwellYSR

Member
too many dots... if you're backing up one directory it's going to be ../ if you want to back up two directories it's ../../ and so on
 

gregt

New Member
do not use dots...

if you use no dots it will work no matter what file you call the code from.

this code should work as long as you are not setting a base href...

<link href="/assets/css/bootstrap.css" rel="stylesheet">
<link href="/assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/assets/css/docs.css" rel="stylesheet">

let us know how that works. thanks.
 

CaldwellYSR

Member
if you use no dots it will work no matter what file you call the code from.

this code should work as long as you are not setting a base href...

<link href="/assets/css/bootstrap.css" rel="stylesheet">
<link href="/assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/assets/css/docs.css" rel="stylesheet">

let us know how that works. thanks.

That's only true if assets is in the root directory. What if this is something like a wordpress theme where the theme is in wp-content/themes/mytheme/.... then using / wouldn't work. Please try to be clear with your answers to avoid confusion.
 
Top