强制Internet Explorer 9使用IE 9模式 [英] Force Internet Explorer 9 to use IE 9 Mode
问题描述
我在顶端附近使用HTML5 doctype with X-UA-Compatible meta标记:
I'm using the HTML5 doctype with X-UA-Compatible meta tag near the top:
<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en-us" class="ie6"> <![endif]-->
<!--[if IE 7]> <html lang="en-us" class="ie7"> <![endif]-->
<!--[if IE 8]> <html lang="en-us" class="ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-us"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
...
但有些用户的Internet Explorer 9正在兼容性视图。我怀疑这是因为他们有在兼容性视图中显示所有网站设置已打开。有没有办法强制IE9使用IE9浏览器和文档模式?
But Internet Explorer 9 for some users is rendering the page in compatibility view. I suspect it's because they have the "Display all websites in Compatibility View" setting turned on. Is there a way to force IE9 to use IE9 Browser and Document Mode?
推荐答案
原来的解决方案是设置X -UA兼容HTTP标头中,而不是HTML中:
It turns out that the solution is to set X-UA-Compatible in the HTTP header and not in the HTML:
X-UA-Compatible: IE=edge,chrome=1
这将强制Internet Explorer使用最新的渲染引擎,即使视图已打开。
This will force Internet Explorer to use the latest rendering engine, even if "Display all websites in Compatibility View" is turned on.
这篇关于强制Internet Explorer 9使用IE 9模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!