Linking CSS
Posted: Mon Dec 29, 2008 12:11 pm
I am having problems linking my css file. When I use the following the CSS works:
<link rel="stylesheet" type="text/css" href="./css/styles.css">
but when I use:
<link rel="stylesheet" type="text/css" href="/css/styles.css">
it doesn't work. I am using php includes to extract out reusable code. Like the banner, navigation and footer into separate files. The linking of the css code is found in the banner include file. Here is my problem how do I link the css file in such a way that each web page is able to find it. Do I use absolute path because I have web pages in separate folders. Any help is appreciated.
Thanks
<link rel="stylesheet" type="text/css" href="./css/styles.css">
but when I use:
<link rel="stylesheet" type="text/css" href="/css/styles.css">
it doesn't work. I am using php includes to extract out reusable code. Like the banner, navigation and footer into separate files. The linking of the css code is found in the banner include file. Here is my problem how do I link the css file in such a way that each web page is able to find it. Do I use absolute path because I have web pages in separate folders. Any help is appreciated.
Thanks