为什么这些条件注释告诉我 IE8 是 IE7?

发布于 2024-10-25 23:09:11 字数 1689 浏览 5 评论 0原文

为什么在 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吗?

谢谢。

Why using this HTML page on Internet Explorer 8:

<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>

I get this result?

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

Shouldn't I get IE8?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

戴着白色围巾的女孩 2024-11-01 23:09:11

唯一看起来不正确的评论

根据条件注释
这是 Internet Explorer 7

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

The only comment that appears incorrect it

According to the conditional comment
this is Internet Explorer 7

Is the browser in compatibility mode as this would render as IE7

眉黛浅 2024-11-01 23:09:11

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

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

For local documents, IE8 tends to automatically use the IE7 Compatibility Mode. In that case, IE8 acts as if it was IE7 (with a few quirks).

You’re either testing this locally, or your browser is currently set in IE7 Compatibility Mode.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文