在localhost上开发时,如何让IE9使用符合标准的模式? [英] How do I get IE9 to use standards compliant mode when developing on localhost?

查看:108
本文介绍了在localhost上开发时,如何让IE9使用符合标准的模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据MSDN,我需要强制符合标准的模式是包含HTML 5 doctype:

According to MSDN, all I need to force standards compliant mode is to include the HTML 5 doctype:

http://msdn.microsoft.com/en-us/library/gg699338%28v=vs.85 %29.aspx

当远程提供标记时,它可以正常工作。问题是当我使用相同的标记并从本地运行的apache服务器提供它时。 IE9默认为怪异模式,兼容性视图按钮消失。

And it works when the markup is served remotely. The problem is when I take identical markup and serve it up from an apache server running locally. IE9 defaults to quirks mode, and the compatibility view button goes away.

我在本地进行了大量的开发,如果我只能测试我的代码就失败了IE远程服务的时候。提前致谢。

I do a lot of development locally, and it defeats the purpose if I can only test my code in IE when it's served remotely. Thanks in advance.

推荐答案

尝试添加此项:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

位于页面顶部。我不确定如果你尝试的另一个没有在本地工作,那么它是值得一去的。

At the top of your page. I'm not sure if that will work locally if the other you tried didn't... but it's worth a go.

这篇关于在localhost上开发时,如何让IE9使用符合标准的模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆