Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2011
    Location
    Australia
    Posts
    47
    Thanks
    1
    Thanked 3 Times in 3 Posts

    CSS not working for IE

    I've been learning CSS from www.w3schools.com after re-learning HTML to HTML 4 and XHTML.

    I'm using Firefox and Notepad2 and so far, everything has been going fine and working just as expected...
    I always use http://validator.w3.org/ to make 100% that there isn't even a ! Warning let alone an error.

    I decided to check that everything works OK in IE, as even though I only use Firefox I understand a large percentage of browsers each rightfully have their own favorite browsers.
    However, it seems that as careful as I have tried to be, and as much as everything works 100% for Firefox and Chrome... for some weird reason NONE of my CSS works in IE8 ... nothing at all.

    Seems like IE has totally ignored my line:

    Code:
    <link rel="stylesheet" type="text/css" href="/C:/Documents and Settings/Asher/My Documents/W3S/CSS/CSS1.CSS" />
    Then carried on reading the test of the XHTML in the htm file perfectly.


    I'm sure there has to be something I am unaware about that makes CSS work in IE. So I would greatly appreciate any help or insight that people could provide.


    Cheers,
    Asher
    Last edited by Asher01; 07-15-2011 at 11:42 AM. Reason: Added Resolved Tag

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Seems like IE has totally ignored my line:
    make use of relative paths. If your html file is in the W3S folder, use the path like
    ./CSS/CSS1.CSS or just CSS/CSS1.CSS
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Jul 2011
    Location
    Australia
    Posts
    47
    Thanks
    1
    Thanked 3 Times in 3 Posts
    If I do that then it stops working even in FireFox.

    The thing is, I have a W3S folder and in it there are other folders... one is HTML, where I keep the .htm files and another is CSS where I keep all the .css files.

    Mainly to keep organized and tidy. Also because I often use different computers on the same network.

    I do know that if say, all the .htm and .css files were all in the same folder... I can just link the short way by only specifying the name of the file ...

    I didn't think to test this before but testing just now, it seems this fixes half the issues with IE if I just dump a copy of all relevant files, including pictures in the same folder and only specify the file name.

    However, that brings rise to two questions...

    Firstly, does that mean if I was to upload my pages to a server, everything would go in one folder? Regardless file type being XHTML, CSS, IMG ect ect?

    Secondly, may be kinda hypothetical to some.... why on earth can you reference to the exact file location for Firefox but not IE?
    Last edited by Asher01; 07-15-2011 at 11:20 AM. Reason: Grammar Corrections

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    one is HTML, where I keep the .htm files and another is CSS where I keep all the .css files.
    Then use ../css/css1.css

    PS: File/folder names are case sensitive.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    Asher01 (07-15-2011)

  • #5
    New Coder
    Join Date
    Jul 2011
    Location
    Australia
    Posts
    47
    Thanks
    1
    Thanked 3 Times in 3 Posts
    OK, two dots, that works perfectly for both FireFox and IE. Same for the imbedded and background images.

    Oh and yeah, I'm very careful with capitals... I actually have always tried not using them where possible in all my coding so that way if I do need to use one, it's obvious.
    I suppose that's one of the reasons I didn't find changing to XHTML very difficult.

    Thank you for being very helpful and also quick.
    It really helped ease my frustrations, as none of the tutorials I have explained that.

    Thumbs up to you,
    Asher

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    OK, two dots, that works perfectly for both FireFox and IE. Same for the imbedded and background images.
    FYI: Two dots in the path refers to the parent directory where as the single dot refers to the current directory.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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