...

View Full Version : Resolved CSS not working for IE



Asher01
07-15-2011, 09:46 AM
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:


<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

abduraooft
07-15-2011, 09:52 AM
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

Asher01
07-15-2011, 10:17 AM
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?

abduraooft
07-15-2011, 10:25 AM
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.

Asher01
07-15-2011, 10:40 AM
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

abduraooft
07-15-2011, 10:50 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum