检查 IE 8 是否处于“兼容视图”中是否获取 IEPatch-CSS

发布于 2024-10-07 21:54:49 字数 368 浏览 0 评论 0原文

有没有办法 - 例如使用

我遇到了一个 (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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你不是我要的菜∠ 2024-10-14 21:54:49

请参阅 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 (and document.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文