将 IE8 浏览器模式设置为 IE7 时遇到问题
尽管放置了以下元标记,但我没有得到预期的结果:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
我打开开发人员工具窗口。在出现菜单的同一栏中,有一个名为浏览器模式的项目:默认情况下它仍然显示 IE 8。即使在控制台窗口中执行 document.documentMode 显示“8”。我做错了什么吗?
Inspite of putting the following meta tag I am not getting the expected result:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
I open the developer tool window. In the same bar where the menu appears there is an item called Browser Mode: it still shows IE 8 by default. Even doing document.documentMode in the console window shows "8". Am I doing anything wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该元标记必须是开始头标记之后的第一件事,否则它将不起作用......(在所有其他元标记等之前)
That meta tag MUST be the first thing after the beginning head tag or it wont work... (before all other meta tags etc.)
当您打开开发人员工具栏时,它不会查看元标记,如果您想查看用户使用 IE7 时任何给定网页“将”如何呈现,那么它实际上更适合。工具栏默认为 IE8,因为这是您使用的 IE 版本。
元标记告诉浏览器在呈现地址栏中请求的页面时要使用哪种模式。
The developer toolbar does not look at the meta tag when you open it, it is really more for if you want to see how any given web page "will" render if a user is using IE7. The toolbar just defaults to IE8, because that is the version of IE that you are using.
The meta tag tells the browser which mode to use when it's rendering a page that has been requested in the address bar.