检查 IE 8 是否处于“兼容视图”中是否获取 IEPatch-CSS
有没有办法 - 例如使用
我遇到了一个 (SharePoint-Layout-) 问题,该问题仅在 IE8 处于“IE8 兼容视图”浏览器模式时才会出现,但如果 IE8 处于“IE8”或“IE7”浏览器模式则工作正常。如果我仅使用
Is there a way — for example with something like <!--[if IE 8]>
— to get a stylesheet only for IE8 and IE in «Compatibly View»?
I ran into a (SharePoint-Layout-)Problem, which only occurs if IE8 is in «IE8 Compat View»-Browser-Mode, but works just fine if IE8 is «IE8»- or «IE7»-Browser-Mode. If I get the stylesheet only with <!--[if IE 8]>
, the css will be ignored if IE8 is in compatibly view because it 'behaves like IE7' — the css will only be loaded if IE8 is in «IE8»-Browser-Mode. But I need it also if he is in the «IE8 Compat View»-Browser-Mode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 SO 帖子“检测 IE8 兼容模式”,其中用户 Mark Kamoski 提到了 Microsoft 文章 定义文档兼容性。
如果您浏览到确定文档兼容性模式部分,则可以对
document.documentMode
(对于旧版浏览器则为document.compatMode
)进行测试来确定模式。我不知道如何将其转化为纯 CSS 实现,但您可以使用一些代码动态生成一些 CSS 来实现此目的。See the SO post "Detect IE8 Compatibility Mode", in which user Mark Kamoski mentions the Microsoft article Defining Document Compatibility.
If you browse to the section Determining Document Compatibility Mode, you can use a test on
document.documentMode
(anddocument.compatMode
for older browsers) to determine the mode. I don't know of how to roll this into a purely CSS implementation, but you can dynamically generate some CSS using some code to achieve this.