IE9 ignoring CSS for certain pages?

删除回忆录丶 提交于 2020-01-03 09:03:31

问题


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.


回答1:


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" %>



回答2:


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.



来源:https://stackoverflow.com/questions/3865873/ie9-ignoring-css-for-certain-pages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!