简体   繁体   English

强制兼容模式IE不起作用

[英]Forcing compatibility mode IE not working

I need to display a webpage in compatibility mode. 我需要在兼容模式下显示网页。 I've tried the following tag: 我尝试了以下标签:

<meta http-equiv="X-UA-Compatible" content="IE=11">

But this only works if I have compatibility mode ON. 但这仅在我启用兼容模式的情况下有效。 With compatibility mode ON, the above tag allows me to change which version of IE the document should be displayed in. With compatibility mode OFF, the above tag has no affect. 在兼容模式为ON的情况下,上述标记允许我更改文档应在哪个IE版本中显示。在兼容模式为OFF的情况下,以上标记没有影响。

Shouldn't this work with compatibility mode OFF? 兼容模式为OFF时不行吗?

My situation: Developing website that looks perfect when viewed in IE10/11 with compatibility mode ON. 我的情况:正在开发的网站在兼容模式为ON的情况下在IE10 / 11中查看时看起来很完美。 With it OFF it looks bad. 关闭它看起来很糟。 Fixing it so that it runs without compatibility mode is not an option. 对其进行修复以使其在不兼容模式下运行不是一种选择。 What I need is to force compatibility mode ON for any user that views the site, so that they do not need to manually turn it on. 我需要对查看该网站的任何用户强制启用兼容模式,以便他们无需手动将其打开。 Is this possible? 这可能吗?

Thanks in advance 提前致谢

Use: 采用:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

You should use IE=edge to tell Internet Explorer to use the highest mode available. 您应该使用IE = edge告诉Internet Explorer使用可用的最高模式。

The reason the X-UA-Compatible is not working is because I am using IE11. X-UA-Compatible不起作用的原因是因为我正在使用IE11。 IE8 will turn compatibility mode on automatically, and then as a developer you can set the content mode. IE8将自动打开兼容模式,然后,作为开发人员,您可以设置内容模式。 But IE 10/11 require compatibility mode to be set on manually before you can begin controlling emulation via meta tags. 但是IE 10/11要求先手动设置兼容模式,然后才能开始通过元标记控制仿真。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM