Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE9 ignoring CSS for certain pages?

I have different sites being served up, essentially running off the same code. One page renders correctly, while the other appears to have no CSS available.

When I bring up the IE9 developer console for the broken page, I see:

SEC7113: CSS was ignored due to mime type mismatch

So that explains why the pages render improperly, but the question is, why am I seeing that error on one page, but not the other?

Using fiddler, the same CSS is served to both sites, and both sites have a the metatag:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>

I know IE9 is still in beta, but I am trying to figure out why this is a problem with my site.

like image 378
Alan Avatar asked Oct 05 '10 16:10

Alan


2 Answers

This doesn't look like an IE emulation thing - it sounds like the CONTENT-TYPE in the response isn't "text/css". It looks like IE9 enforces that files that are expected to contain CSS are actually marked as such.

Just out of interest, are the CSS pages processed in any way? i.e. are they rendered by an ASPX page to allow you to inject CSS? If that's the case then you may want to make sure your page declaration at the top includes the ContentType declaration, e.g.:

<%@ Page Language="C#" ContentType="text/css" %>
like image 90
Mike Goatly Avatar answered Oct 07 '22 01:10

Mike Goatly


It turns out, IE9 will ignore the missing content-types for all sites that in your "trusted-zone."

Sites outside of the trusted zone will not render the css if there is a missing content-type header.

like image 26
Alan Avatar answered Oct 06 '22 23:10

Alan