sitemap

External CSS won’t load in IE7

I just spent a while wondering why IE7 wouldn't make use of an external stylesheet when it worked in Firefox no problems.

The page is in UTF-8 and the .css file was also encoded in UTF-8 but IE7 simply refused to render the page using the CSS rules.

I have no idea  what the problem is but if you are having similar issues try putting @charset “UTF-8″; at the top of your external stylesheet - it worked for me.

Does anyone know what the underlying issue is?


Posted by Daniel Skinner 7 months, 2 weeks ago


Trackback Button Comments RSS 2.0 Button

Categories: Web Development

Tags: , , , ,

Comments

pkenjora:

I had similar issues for a while, my solution was to include the W3C header at the top of my pages.

I think strict is preferred but I needed loose for some weird css or something.

Daniel Skinner:

Yes, it’s strange. Actually, I ended up taking @charset “UTF-8″; out in the end as it invalidated the CSS file.

Yeah, strict doctypes can have an effect on the CSS, for example, the box model. However, I have always found less issues when coding to strict.

Leave a Reply