如何仅针对ie9的css?
我需要使用css使ie9成为如何仅针对ie9的css?,css,Css,我需要使用css使ie9成为float:left
float:left但是对于所有其他浏览器,它应该是float:none代码>。因此,我尝试了以下不起作用的方法:
li{
float: none !important;
float: left !important \9;
}
我如何只针对IE9。对于这一行css,我宁愿不包含外部css。使用如下方式:
li{
float: none !important;
float: left \9 !important;/* \9 is used after left not after important*/
}
!重要信息
应始终位于末尾。定义css样式时,请参见!重要信息
应位于末尾。
试试这个
也可以使用条件注释
<!--[if IE 9]>
<style>
Special instructions for IE 9 here
</style>
<![endif]-->
我用的是这样的东西-
<!--[if IE 9]><!-->
//your style or script
<!--<![endif]-->
//你的风格或剧本
gte
:大于(或)等于。您正在寻找[如果IE 9]
您应该避免使用!important@Sidsec9在某些情况下,我们需要使用它。
<!--[if IE 9]><!-->
//your style or script
<!--<![endif]-->