X-UA-Compatible设置IE浏览器兼容模式

文件兼容性用来告诉IE,让它如何来编译你的网页。

指定 文件兼容性模式

以下是指定为Emulate IE7 mode 兼容性范例。

<html>
<head>
<!-- Mimic Internet Explorer 7 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>Title</title>
</head>
<body>
    <p>Content.</p>
</body>
</html>

其内容随著指定的页面模式而更改,当要模拟IE7时,指定IE=EmulateIE7,指定IE=5, IE=7, 或IE=8来选择其中一种兼容性模式。

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

可以指定IE=edge来指示IE8使用它支持的最高模式。
实际上IE只会执行网页中第一个X-UA-Compatible标头。

posted @ 2016-04-16 13:37  Sameen  阅读(256)  评论(0编辑  收藏  举报