。。还是<meta httpequiv="XUACompatible" content="IE=7" />的问题

。。还是<meta http-equiv="X-UA-Compatible" content="IE=7" />的问题

我怎么三天两头碰到这家伙的问题,太有缘了。

最近做日常发现

<meta http-equiv="X-UA-Compatible" content="IE=7" />

这句话并没有生效,ie8还是依照ie8的文本模式去渲染。

查了之后发现,这句话之前多了一段script。。。

MSDN:http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx

上面说:

TheX-UA-compatible header is not case sensitive; however, it must appear in theWeb page's header (the HEAD section) before

allother elements, except for the title element and other metaelements.

意味着<metahttp-equiv="X-UA-Compatible" content="IE=7" />这句话必须放在所有tag之前,不然是没有效果的。 

原文地址:https://www.cnblogs.com/xiziyin/p/1806474.html