兼容IE的CSS的”引入方式“

1.给IE浏览器的7版本来提供需要引用的样式(如果把7去掉则给所有的IE浏览器提供样式)

<!--[if IE 7]>

<Link type="text/css" href="test.css" ... />
<![endif]-->
2.针对大于IE7的情况如下
<!--[if gt IE 7]>
<Link type="text/css" href="test.css" ... />
<![endif]-->
3.针对小于IE7的情况如下
<!--[if lt IE 7]>
<Link type="text/css" href="test.css" ... />
<![endif]-->
4.针对刨除IE7的情况如下(仅在IE7上不生效)
<!--[if ! IE 7]>
<Link type="text/css" href="test.css" ... />
<![endif]-->
5.属性前缀法(推荐)
内联样式:  <div style="_width:100px(IE6有效); *width:10px(IE6,7均有效);"></div>
5.选择符前缀法(推荐)
外部样式:  *html  test{border: red 1px solid;  ...}(只对IE6有效)
                *+html  test{border: green 1px solid;  ...}(只对IE7有效)
备注:
不仅仅是可以包含CSS外部文件,也可以包含CSS的嵌入形式(也可以是JS的文件和嵌入形式)
posted @ 2015-03-02 14:42  soft.push("zzq")  Views(291)  Comments(0Edit  收藏  举报