3

为什么在 Internet Explorer 8 上使用此 HTML 页面:

<p>
<!--[if IE]> According to the conditional comment this is Internet Explorer<br /><!    [endif]-->
<!--[if IE 5]> According to the conditional comment this is Internet Explorer 5<br /> <![endif]-->
<!--[if IE 5.0]> According to the conditional comment this is Internet Explorer 5.0<br /> <![endif]-->
<!--[if IE 5.5]> According to the conditional comment this is Internet Explorer 5.5<br /> <![endif]-->
<!--[if IE 6]> According to the conditional comment this is Internet Explorer 6<br /> <![endif]-->
<!--[if IE 7]> According to the conditional comment this is Internet Explorer 7<br /> <![endif]-->
<!--[if gte IE 5]> According to the conditional comment this is Internet Explorer 5 and up<br /><![endif]-->
<!--[if lt IE 6]> According to the conditional comment this is Internet Explorer lower than 6<br /> <![endif]-->
<!--[if lte IE 5.5]> According to the conditional comment this is Internet Explorer lower or equal to 5.5<br /> <![endif]--> 
<!--[if gt IE 6]> According to the conditional comment this is Internet Explorer greater than 6<br /> <![endif]--> 
</p>

我得到这个结果?

According to the conditional comment this is Internet Explorer
According to the conditional comment this is Internet Explorer 7
According to the conditional comment this is Internet Explorer 5 and up
According to the conditional comment this is Internet Explorer greater than 6

我不应该得到IE8吗?

谢谢。

4

2 回答 2

5

唯一出现不正确的评论

根据有条件的评论,这是 Internet Explorer 7

浏览器是否处于兼容模式,因为这将呈现为 IE7

于 2011-03-24T09:31:45.317 回答
2

对于本地文档,IE8 倾向于自动使用 IE7 兼容模式。在这种情况下,IE8 就像 IE7 一样(有一些怪癖)。

您要么在本地进行测试,要么您的浏览器当前设置为 IE7 兼容模式。

于 2011-03-24T09:56:10.450 回答