html - 使用标签强制关闭 IE 兼容模式

标签 html internet-explorer

我正在为一个在所有 Intranet 站点上强制使用兼容模式的客户工作。我想知道是否可以在我的 HTML 中添加一个标签来强制关闭兼容模式。

最佳答案

There is the "edge" mode .

<html>
   <head>
      <meta http-equiv="X-UA-Compatible" content="IE=edge" />
      <title>My Web Page</title>
   </head>
   <body>
      <p>Content goes here.</p>
   </body>
</html>

从链接的 MSDN 页面:

Edge mode tells Windows Internet Explorer to display content in the highest mode available, which actually breaks the “lock-in” paradigm. With Internet Explorer 8, this is equivalent to IE8 mode. If a (hypothetical) future release of Internet Explorer supported a higher compatibility mode, pages set to Edge mode would appear in the highest mode supported by that version; however, those same pages would still appear in IE8 mode when viewed with Internet Explorer 8.

但是,在生产环境中不鼓励使用“边缘”模式:

It is recommended that Web developers restrict their use of Edge mode to test pages and other non-production uses because of the possible unexpected results of rendering page content in future versions of Windows Internet Explorer.

老实说,我不完全明白为什么。但据此,目前最好的方法是使用 IE=8

关于html - 使用标签强制关闭 IE 兼容模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3449286/

相关文章:

javascript - IE userData 行为在 Windows Phone 7 的 IE 中不起作用

jquery - 选择单个类元素

javascript - mouseenter 和 mouseleave 停止动画

html - IE - 如何在文本区域中保留空白,使用 javascript 字符串输入

javascript - IE 在 href =""上打开文件资源管理器

typescript - 在生产中禁用 console.log()

HTML/CSS - 无法解释的边距

html - 除页面外的DIV

javascript - 允许的 cookie 数量限制? - err_spdy_protocol_error

c# - 使用 IE 缓存