创建样式表的级联,如下所示:
<link id="stylesheet1" rel="stylesheet" href="css/style.css" type="text/css" media="all" /
<!--[if IE]>
<link id="stylesheet2" rel="stylesheet" href="css/ie.css" type="text/css" media="all" />
<![endif]-->
<!--[if lte IE 6]>
<link id="stylesheet3" rel="stylesheet" href="css/ie6.css" type="text/css" media="all" />
<![endif]-->
<!--[if lte IE 5]>
<link id="stylesheet4" rel="stylesheet" href="css/ie5.css" type="text/css" media="all" />
<![endif]-->
样式表:
.myclass{
width:100px;
}
ie.css文件:
/* override class from style.css */
.myclass{
width:105px;
}
/* override class again from ie.css */
.myclass{
width:110px;
}
ie5.css格式:
/* if necessary, override class again from ie6.css */
.myclass{
width:115px;
}
Pekka是对的,您需要根据具体情况来考虑每个问题/错误/显示差异。因此,如果IE6中没有正确显示某些内容,则需要在中进行调整
ie6.css
. 即使在那之后,它也没有在IE5中显示出来,你需要在IE5中调整它
ie5.css
.
说明:
<!--[if IE]>
only Internet Explorer browsers (all versions) will see HTML between these statements
<![endif]-->
<!--[if lte IE 6]>
only Internet Explorer 6 or lower browsers will see HTML between these statements
<![endif]-->
<!--[if lte IE 5]>
only Internet Explorer 5 or lower browsers will see HTML between these statements
<![endif]-->