我正在为一个在所有 Intranet 站点上强制使用兼容模式的客户工作。我想知道是否可以在我的 HTML 中添加一个标签来强制关闭兼容模式。
最佳答案
<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/