IE8兼容模式
我创建了一个网站,当从本地服务器查看时,该网站可以在包括 IE8 在内的所有浏览器中正确显示 http://localhost
但是,当我从另一台机器上查看网站,http://pc5008 例如,IE8 进入了看起来像兼容模式的状态,看起来很糟糕。
额外信息
从本地主机查看时,IE8 提供了以兼容模式查看的选项。如果我选择此选项,它看起来与在非本地主机上查看时相同,即很糟糕。
在非本地主机上查看时,IE8 不显示以兼容模式查看的选项。 (“工具”下的兼容模式呈灰色)
此外,所有内容都经过 XHTML 1.0 Strict 验证。
I've created a website that displays correctly in all browsers including IE8 when viewed from my local server i.e. http://localhost
However when I view the website from another machine, http://pc5008 for example, IE8 goes into what seems like compatibility mode and looks terrible.
Extra Info
When viewed from the localhost IE8 gives an option to view in compatibility mode. If I choose this option it looks the same as when viewed on the non-localhost i.e. terrible.
When viewed on the non-localhost IE8 doesn't show the option to view in compatibility mode. (compatibility mode under Tools is greyed out)
Also, everything validates as XHTML 1.0 Strict.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对这个主题不是很熟悉,但是据我所知 IE 根据 doctype 声明选择它的模式(标准/怪异模式)。检查您的文档类型是否正确。
也许这篇文章会有所帮助:使用 Doctype 激活浏览器模式。
如果问题最终出在 doctype 上,请尝试将其声明为 html5 样式:
I'm not very familiar with the subject, however as I know IE chooses it's mode (standard/quirks-mode) based on doctype declaration. Check if your doctype is correct.
Maybe this article will help: Activating Browser Modes with Doctype.
If the problem is eventually with doctype, try declaring it html5 style:
事实证明,IE8 在
Tools\Compatibility View Settings\
下有一个名为“在兼容性视图中显示 Intranet 站点”的选项。禁用此功能可以解决我的问题。另一个解决方案是将以下行添加到头部:
这会覆盖设置。
In turns out that IE8 has an option under
Tools\Compatibility View Settings\
called 'Display intranet sites in Compatibility View'. Disabling this feature fixes my problem.Another solution is to add the following line to the head:
This overrides the setting.