Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Internet explorer 特定版本的IE条件注释不起作用_Internet Explorer - Fatal编程技术网

Internet explorer 特定版本的IE条件注释不起作用

Internet explorer 特定版本的IE条件注释不起作用,internet-explorer,Internet Explorer,我想ie的条件评论只有ie7。下面是我为ie7编写的代码 它在ie7上工作得很好,但是为什么相同的css在ie8和ie9上工作。它应该只适用于ie7,对吗? 我的密码有什么遗漏吗。如果是,请建议。 任何帮助都将不胜感激。 提前感谢。您需要这个: <!--[if IE 7]> <link href="css/ie7.css" rel="stylesheet"> <![endif]--> 请查看此处了解更多详细信息: 您正在做的是包含IE7及以下版本的CS

我想ie的条件评论只有ie7。下面是我为ie7编写的代码

它在ie7上工作得很好,但是为什么相同的css在ie8和ie9上工作。它应该只适用于ie7,对吗? 我的密码有什么遗漏吗。如果是,请建议。 任何帮助都将不胜感激。 提前感谢。

您需要这个:

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

请查看此处了解更多详细信息:

您正在做的是包含IE7及以下版本的CSS文件(lte->小于等于)

使用此-

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

更新-


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

感谢您的回复,但在IE8和IE9中仍然存在冲突。我不想在ie8和ie9中使用相同的样式。那么你还有其他错误。这很有效。您可能在其他位置包含相同的CSS文件。好的,我想我搞错了。我正在使用Windows7。当我将internet explorer的浏览器模式设置为“internet explorer 9压缩视图”并不断更改文档模式(ie7、ie8、ie9)时,条件注释样式适用于ie的每个版本。如果我将浏览器模式从“ie压缩视图”更改为ie 7,则条件注释样式有效。现在开始工作了。谢谢(很抱歉我的英语不好)它在ie8和IE9中仍然存在冲突,感谢它是在兼容模式下呈现的。