View Full Version : IE stylesheet not being applied

Nov 5th, 2009, 03:30 AM
for my site (http://www.21centuryinc.com/new_index1.html) i created an IE style sheet called ie21stcentury.css that contains the following code:

/* CSS Document */

#wrapper {
overflow: none;
#content {
background-color: #F92325;

and at the top of my HTML page, right before the close head tag I put:

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="../public/ie21stcentury.css" />

how come it isn't getting applied? it should be easy to tell because i gave the middle content portion a red background.

any idea what's wrong? thanks!

Nov 5th, 2009, 04:42 AM
Why do you have your link url starting with ../

../ means go up one level in the directory structure.
So if your page is at www.whatever.com/mysite/index.html then using ../ says to go up one level to www.whatever.com/ so ../images would go up one level from your document at www.whatever.com/mysite/ to www.whatever.com/ and then from there to www.whatever.com/images/

A document relative link looks like this images/one.gif which will go from your document at www.whatever.com/mysite/ to www.whatever.com/mysite/images/one.gif

A site root-relative link looks like this /images/one.gif which will jump from your document (wherever it may be) to the site root www.whatever.com/ and then from there to www.whatever.com/images/one.gif

The only difference between the root-relative link and the document-relative link is that the root-relative link has a / at the begining and the document-relative link does not.

Being that your index file is already located at your site root ../ jumping up one level doesn't make much sense (and may not be possible?). If you are really meaning to use a root-relative link then just remove the .. or if you are really trying to store your file above the root directory of the site on the server then you should probably rethink that plan. I suspect that the second case is true and you are using the ../ correctly but your server will not let you serve files from anywhere above the site root so you had better put the file within the actual site structure and not in the /public/ directory which is actually above your site's root and therefore outside of the site's actual directory structure.