确定为什么页面在兼容模式下呈现?
我遇到布局问题,这是由于包含页面在 IE8 上以兼容模式呈现。有没有办法检测导致 IE8 进入特定页面兼容模式的原因?
根据微软的文档,以下情况可能会导致页面以兼容模式呈现(http://msdn.microsoft.com/en-us/library/cc288325%28VS.85%29.aspx):
- 页面已启用兼容性视图。
- 该页面会在 Intranet 区域中加载,并且 Internet Explorer 8 会在兼容性视图中配置为 Intranet 区域中的页面。
- Internet Explorer 8 配置为在兼容性视图中显示所有网站。
- Internet Explorer 8 配置为使用兼容性视图列表,该列表指定一组始终显示在兼容性视图中的网站。
- 开发人员工具用于覆盖网页中指定的设置。
- 网页遇到页面布局错误,Internet Explorer 8 配置为通过在兼容性视图中重新打开页面来自动从此类错误中恢复。
检查页面后,我排除了第一种可能性,即页面上的页面布局错误。我想找出这个错误。
I have a layout issue which is due to the containing page being rendered in compatibility mode on IE8. Is there a way to detect whats causing IE8 to enter compatibility mode for a particular page?
According to Microsoft's documents, the following conditions can cause a page to be rendered in compatibility mode (http://msdn.microsoft.com/en-us/library/cc288325%28VS.85%29.aspx):
- Compatibility View is enabled for the page.
- The page is loaded in the Intranet zone and Internet Explorer 8 is configured to pages in the Intranet zone in Compatibility View.
- Internet Explorer 8 is configured to display all Web sites in Compatibility View.
- Internet Explorer 8 is configured to use the Compatibility View List, which specifies a set of Web sites that are always displayed in Compatibility View.
- The Developer Tools are used to override the settings specified in the Web page.
- The Web page encountered a page layout error and Internet Explorer 8 is configured to automatically recover from such errors by reopening the page in Compatibility View.
After reviewing the page, I've ruled out the first possibilities such that it must be a page layout error on the page. I'd like to locate this error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查您是否有任何
;标签强制 IE 进入兼容模式。如果您愿意,您可以强制它呈现为 IE8(完全兼容 CSS 2.1):
Check if you have any <meta> tags forcing IE into compatibility mode.
You can force it to render as IE8 (fully CSS 2.1 compliant) if you wish:
假设您有一个 ID 为 compat-warning:
Javascript w/ jQuery:
检测和警告的隐藏元素,这是您抵御兼容性地狱的第一道也是最后一道防线。
Assuming you have a hidden element with the ID compat-warning:
Javascript w/ jQuery:
Detection and warnings, your first and last lines of defense against compatibility hell.