<!--[if lt IE 9]>
This is less then IE9
ELSE
this is all browsers: firefox, chrome, etc.
<![endif]-->
我如何在我的HTML中做到这一点?我想做一个"else“...
发布于 2011-07-19 11:55:44
你不是在寻找其他的东西,你是在寻找<![if !IE]> <something or other> <!--[endif]>
(注意这不是一个注释)。
<!--[if IE]>
You're using IE!
<![endif]-->
<![if !IE]>
You're using something else!
<![endif]>
您可以在conditional comments here上找到文档。
发布于 2013-03-02 23:47:24
我使用以下代码在IE9或更高版本以及所有其他浏览器中加载资源
<!--[if gte IE 9]><!-->
//your style or script
<!--<![endif]-->
这很难让人相信。查看开头和结尾的if语句部分在注释中(所以,它对其他浏览器是不可见的),但对IE是可见的。
发布于 2015-01-22 18:05:49
您的问题的解决方案是(请注意<!-- -->
的使用):
<!--[if lt IE 9]>
This is less then IE9
<![endif]-->
<!--[if gt IE 8]> <!-- -->
this is all browsers: IE9 or higher, firefox, chrome, etc.
<!-- <![endif]-->
https://stackoverflow.com/questions/6742087
复制相似问题