使用标签强制关闭 IE 兼容模式 [英] Force IE compatibility mode off using tags

查看:18
本文介绍了使用标签强制关闭 IE 兼容模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am doing work for a client who forces compatibility mode on all intranet sites. I was wondering if there is a tag I can put into my HTML that forces compatibility mode off.

推荐答案

有边缘"模式.

<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 页面:

From the linked MSDN page:

边缘模式告诉 Windows Internet Explorer 以可用的最高模式显示内容,这实际上打破了锁定"范式.对于 Internet Explorer 8,这相当于 IE8 模式.如果(假设的)未来版本的 Internet Explorer 支持更高的兼容模式,则设置为边缘模式的页面将显示为该版本支持的最高模式;但是,当使用 Internet Explorer 8 查看时,这些相同的页面仍会出现在 IE8 模式下.

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.

但是,不鼓励在生产中使用边缘"模式:

However, "edge" mode is not encouraged in production use:

建议 Web 开发人员将 Edge 模式的使用限制为测试页面和其他非生产用途,因为在未来版本的 Windows Internet Explorer 中呈现页面内容可能会出现意外结果.

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.

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

I honestly don't entirely understand why. But according to this, the best way to go at the moment is using IE=8.

这篇关于使用标签强制关闭 IE 兼容模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆