开发者

What are some reasons IE9 wouldn't render the css in an iFrame?

I have a site with an iFrame in it, and the iFrame gets almost rendered correctly. There's just one problem -- a couple of the stylesheets don't get applied!

Confusingly, the stylesheets get applied when you go directly to the p开发者_C百科age, not in an iFrame.

WTFIE9?


Hit F12. Look at the Console tab, which will explain why your stylesheet wasn't applied. My guess is that the CSS file isn't sent with the text/css MIME-type. IE9 requires a proper MIME type for IE9 Standards Mode pages.


This might be a doctype issue affecting frames in IE. As explained on CSS Tricks:

If you are creating a page using HTML5 and you think there is some reasonable chance that someone may embed this page on another via iframe, you should use the HTML5 shim on it for all version of IE.

<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜