有没有办法从CSS内部调用IE条件?我想避免从代码中调用一长串IE浏览器的css文件。巩固CSS IE调用
<!--[if IE 7]>
<link href="ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if IE 8]>
<link href="ie8.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if gt IE 8]>
<link href="ie-gt-8.css" rel="stylesheet" type="text/css" />
<![endif]-->
,并希望能有一个呼叫
<!--[if IE]>
<link href="ie.css" rel="stylesheet" type="text/css" />
<![endif]-->
,并有CSS文件中的条件语句。这是可能的还是Paul Irish的路要走?
我试图采用“高级规则”建议在this article
#column_right {
float:left;
width:250px;
margin-left:-250px;
[if IE 6] ie6: 100%;
[if lt IE 6] lt-ie6: 100%;
[if lte IE 6] lte-ie6: 100%;
[if ! lte IE 6] not-lte-ie6: 100%;
}
#footer {
clear: left;
width: 100%;
[if IE 5.0] padding: 10px 0px;
[if IE 5.5] margin-bottom: 40px;
}
[if IE 5] .box {
width: 200px;
padding: 100px;
margin: 100px;
}
但这并不为我工作。我尝试了一些基本的东西,比如
[if IE 7] background-color: red;
[if IE 8] background-color: yellow;
这是可能的。看到我的回答 –
是的,你可以做到这一点。那是我忘记的一个。但我更专注于有条件的评论_in_ CSS。这是不可能的。但是你的风格会解决问题。 – Ktash