IE 的文档兼容模式(X-UA-Compatible):IE 浏览器支持多种文档兼容模式,得以因此改变页面的渲染效果:

(1)、IE9 模式:<meta http-equiv="X-UA-Compatible" content="IE=9">;

(2)、IE8 模式:<meta http-equiv="X-UA-Compatible" content="IE=8">;

(3)、IE7 模式:<meta http-equiv="X-UA-Compatible" content="IE=7">;

 

和 IE9 模式不同的是,Emulate IE9 模式会考虑指令,Emulate IE9 模式告诉 IE 使用指令来决定如果渲染文档。

(1)、IE9 模式:<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">;

(2)、IE8 模式:<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">;

(3)、IE7 模式:<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">;

 

Edge 模式告诉 IE 以最高级模式渲染文档,任何 IE 版本都以当前版本所支持的最高级标准模式渲染,避免版本升级造成的影响。

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

 

强制 IE 使用 Chrome Frame 渲染

<meta http-equiv="X-UA-Compatible" content="chrome=1">;

 

提示 IE 用户安装 Google Frame
Google 官方提供了对 Google Frame 插件安装情况的检测,并未安装 Google Frame,则弹出对话框提示安装

<script src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script><script>CFInstall.check();</script>

 

同时兼容IE和Chrome的兼容模式方案:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

参考资料: