“X-UA-兼容"内容=“IE=9;IE=8;IE=7;IE=边缘" [英] "X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE"
问题描述
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
这句话究竟是什么意思?
Actually what is the meaning of this statement ?
有些例子使用,
来分隔IE的版本,有些则使用;
;哪个是正确的?
Some of the examples use ,
to separate versions of IE, while some use ;
; which is correct?
命令IE=9;IE=8;IE=7;IE=EDGE
有一些重要性,我想知道.
The order IE=9; IE=8; IE=7; IE=EDGE
has some importance, I wish to know that.
编辑:我正在使用
推荐答案
如果您支持 IE,对于 Internet Explorer 8 及更高版本,此:
If you support IE, for versions of Internet Explorer 8 and above, this:
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7" />
强制浏览器呈现为该特定版本的标准.IE7 及以下不支持.
Forces the browser to render as that particular version's standards. It is not supported for IE7 and below.
如果用分号分隔,它会设置不同版本的兼容性级别.例如:
If you separate with semi-colon, it sets compatibility levels for different versions. For example:
<meta http-equiv="X-UA-Compatible" content="IE=7; IE=9" />
将 IE7 和 IE8 渲染为 IE7,但将 IE9 渲染为 IE9.它允许不同级别的向后兼容性.但在现实生活中,您应该只选择其中一个选项:
Renders IE7 and IE8 as IE7, but IE9 as IE9. It allows for different levels of backwards compatibility. In real life, though, you should only chose one of the options:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
这样可以更轻松地进行测试和维护.虽然通常更有用的版本是使用 Emulate:
This allows for much easier testing and maintenance. Although generally the more useful version of this is using Emulate:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
为此:
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
它强制浏览器以最新版本的标准进行渲染.
It forces the browser the render at whatever the most recent version's standards are.
有关更多信息,有很多在 MSDN 上阅读、
这篇关于“X-UA-兼容"内容=“IE=9;IE=8;IE=7;IE=边缘"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!