Firefox Ignoring External Stylesheet

Associate
Joined
15 Nov 2002
Posts
816
Has anyone come across a problem with Firefox before where it doesn't apply an external stylesheet?

I'm messing around with a site (locally) and it works fine in both Opera 8.5 and IE6, but Firefox does not apply the stylesheet at all and just displays the text content.

Can't for the life of me work out why :confused:

I have read it maybe something to do with the web server configuration, but I can't find out what it is. I am using WAMP 1.6.1 for reference and Firefox version 1.5 - although previous versions do the same thing.

Any help appreciated.

Cheers
Paul
 
Last edited:
How exactly are you linking to the stylesheet? You should use one of the following in the <head> section of your HTML file:
Code:
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="all" />
or even better:
Code:
<style type="text/css">
@import url(stylesheet.css);
</style>
 
Thanks for the reply.

I was using..

Code:
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="all" />

..which works fine as mentioned in IE6 and Opera.

Have changed it to the import method and it's fixed the problem! :D

No idea why still as I've always used the previous method before without problem.

Oh well, live and learn! :)
 
Al Vallario said:
How exactly are you linking to the stylesheet? You should use one of the following in the <head> section of your HTML file:
Code:
<link rel="stylesheet" href="stylesheet.css" type="text/css" media="all" />
or even better:
Code:
<style type="text/css">
@import url(stylesheet.css);
</style>
Id disagree that @import is "better" as you put it than using the link tag, as @import its less compatible than link. Ok, we are talking about old browsers here but still it should be used over @import.

This also defeats the thread in a way, as there is obviously a problem with the markup of the link tag in his document.

Paul, Can you post exactly what you have?
 
yup firefox is strict - I mean it obeys standards well but any slight deviation and your webpage wont work, whereas IE will sometimes still muddle through.

Must be something slightly out of place in that line...
 
Oops, I've spotted what I originally did :o

Originally, I was refering to the stylesheet with this line...

Code:
<link href="styles\styles.css" rel="stylesheet" type="text/css" media="all" />

And I've now changed it to the following and it works just fine! :p

Code:
<link rel="stylesheet" href="styles/styles.css" type="text/css" media="all" />

I'm still learning so forgive my stoopidness! :D

(Might of helped if I'd copied the correct code into my earlier post in the first place)! :o
 
Last edited:
roboffer said:
Id disagree that @import is "better" as you put it than using the link tag, as @import its less compatible than link. Ok, we are talking about old browsers here but still it should be used over @import.
I've just read up on the subject again and it seems the best practice is to use a combination of linking and importing. Apparently you should link to a stylesheet with basic styling which old browsers can understand, and import a stylesheet containing all the sophisticated CSS which older browsers would "bungle."

av. :)
 
Al Vallario said:
I've just read up on the subject again and it seems the best practice is to use a combination of linking and importing. Apparently you should link to a stylesheet with basic styling which old browsers can understand, and import a stylesheet containing all the sophisticated CSS which older browsers would "bungle."

av. :)
Id personally just sod the older browsers :D

I code for Firefox, IE7/6, Opera, IE5 and maybe a few Mac ones if I can be bothered. @import causes problems with N4 which should be completely ignored. @import is really, as valid as link but I wouldnt recommend using it.

Its a different issue to the original thread, but there should be a line drawn to stop supporting older browsers, I work for clients that only support browsers that 5% or above of their users use. And Im talking major business here.

People with old depreciated browsers need to be given a nudge in the right direction and forced to upgrade.
 
Back
Top Bottom