我想避免这种情况。我试过了:
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">(来自HTML5 doctype putting IE9 into quirks mode? )和:
<meta http-equiv=”X-UA-Compatible” content=”IE=9″ />(来自Disable quirks mode for parent frame )
但两者都无济于事。当我执行F12 (文档模式IE9标准)时,页面显示良好。
有什么解决方案吗?
发布于 2012-11-07 05:52:56
如果该页是本地的或在Intranet上,则Internet Explorer默认为quirks模式。
如果您将相同的页面放在Web上,它将按预期运行。
当您使用ASP.NET时,要让它按您所希望的那样工作,您可以在web.config文件中添加以下内容:
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>这避免了必须覆盖所有Intranet页面的用户设置。
发布于 2014-01-09 13:03:18
我在本地运行页面时遇到了这个问题。我使用的是HTML5,而我的页面是从<html>开始的。
当我添加<!DOCTYPE html>时,它神奇地开始工作了(即使是在本地)。
在上下文中:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<add name="X-UA-Compatible" value="IE=edge" />
</head>More info about IE8 and doctype.
https://stackoverflow.com/questions/13259958
复制相似问题