- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
对于我们的 Web 应用程序,我们为所有页面发送 X-UA-Compatible -> IE=EmulateIE7。但是,刷新按钮旁边的兼容性 View 按钮仍会显示。
1)这是预期的行为吗?
2) HTTP header 不应该强制浏览器以 IE7 模式显示(启用 Quirks + IE7Standards),然后显示兼容性 View 按钮?
如果站点没有准备好 IE8,有没有办法强制 IE7 模拟,从而禁用此按钮?
最佳答案
根据 Just The Facts: Recap of Compatibility View,您已经通过使用版本控制标记声明 [您的网站]“准备好”用于 Internet Explorer 8。不应显示兼容性 View 按钮:
Site owners are always in control of their content. By default, Internet Explorer uses DOCTYPE switching to determine Quirks v. Standards mode (again, Standards mode maps to IE8 Standards by default). Site owners can choose to use the X-UA-Compatible tag to be absolutely declarative about how they’d like their site to display and to map Standards mode pages to IE7 Standards. Use of the X-UA-Compatible tag overrides Compatibility View on the client.
Sometimes the Compatibility View button isn’t displayed. The button is located on the address bar next to the ‘stop’ and ‘refresh’ buttons. There are a few cases where there’s no action for a user take and, thus, the Compatibility View button will not show:
- If you're viewing an internal-to-Internet Explorer page (such as about:InPrivate)
- If you're viewing a page that has declared it's "ready" for Internet Explorer 8 through use of the versioning tag / HTTP header (it doesn’t matter if this tag triggers Quirks, IE7 Standards, or IE8 Standards, the button won’t be displayed)
- If you're viewing an intranet page and you have the ‘Display intranet sites in Compatibility View’ checkbox selected
- If you're viewing any webpage and you have the ‘Display all websites in Compatibility View’ checkbox selected
- If you're viewing a webpage that is included on the Microsoft-supplied compatibility view updates list and you have the ‘Include updated website lists from Microsoft’ checkbox selected
- If you've toggled either the ‘Document Mode’ or ‘Browser Mode’ settings via the Developer Toolbar
X-UA-Compatible
header 实际上是在每个页面上传递的?
META
标签,那么根据
META Tags and Locking in Future Compatibility :
The X-UA-compatible header is not case sensitive; however, it must appear in the Web page's header (the HEAD section) before all other elements, except for the TITLE element and other META elements.
Tools
> Compatibility View Settings
关于internet-explorer-8 - 即使 IE=EmulateIE7 也启用 IE8 兼容性 View 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/897409/
我是一名优秀的程序员,十分优秀!