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

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

问题描述

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

http://msdn.microsoft.com/en-en/library/cc817574.aspxrel =noreferrer>有边缘模式。

 < html> 
< head>
< meta http-equiv =X-UA-Compatiblecontent =IE = edge/>
< title>我的网页< / title>
< / head>
< body>
< p>内容放在此处。< / p>
< / body>
< / html>

从链接的MSDN页面:


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


然而,不鼓励边缘模式在生产中使用:


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


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


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.

解决方案

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>

From the linked MSDN page:

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:

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.

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天全站免登陆