IE特定版本的条件评论不起作用

时间:2012-11-28 08:26:16

标签: internet-explorer

我想要ie条件评论只有ie7。以下是我为ie7做的以下代码。

<!--[if lte IE 7]> <link href="css/ie7.css" rel="stylesheet"> <![endif]-->

它在ie7上工作得很好但是为什么同一个css正在研究ie8和ie9。它应该只适用于ie7对吗? 代码中是否有任何遗漏。如果是,请建议。 任何帮助将不胜感激。 提前谢谢。

2 个答案:

答案 0 :(得分:0)

你需要这个:

<!--[if IE 7]>
<link href="css/ie7.css" rel="stylesheet">
<![endif]-->

点击此处了解更多详情:http://www.quirksmode.org/css/condcom.html

您正在做的是包括IE 7及更低版本的CSS文件(lte - &gt;小于等于)

答案 1 :(得分:0)

使用此 -

<!--[if IE 7]>
  According to the conditional comment this is IE 7<br />
<![endif]-->

<强>更新 -

如果仍然继续,请检查您的网站是否以兼容模式呈现,因为它呈现为IE7

相关问题