Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2009
    Thanked 0 Times in 0 Posts

    IE stylesheet not being applied

    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!

  • #2
    Regular Coder
    Join Date
    Nov 2009
    Thanked 9 Times in 9 Posts

    why use ../ ?

    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.

  • Users who have thanked linehand for this post:

    sixrfan (11-05-2009)


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts