IE9的css hack
时间:2011年06月22日作者:愚人码头查看次数:2,009 views评论次数:22
以前写过《IE8的css hack》,ie9一出css hack也该更新,以前一直没关注,今天在内部参考群mxclion分享了IE9的css hack,拿出来也分享一下:
1 | select { |
2 | background-color : red \ 0 ; /* ie 8/9*/ |
3 | background-color : blue \ 9 \ 0 ; /* ie 9*/ |
4 | * background-color : #dddd00 ; /* ie 7*/ |
5 | _background-color : #CDCDCD ; /* ie 6*/ |
6 | } |
注意写hack的顺序,其中:
- background-color:red\0;IE8和IE9都支持;
- background-color:blue\9\0; 仅IE9支持;
更多其他hack关注:http://www.css88.com/archives/1681。
感谢mxclion,感谢内部参考群!
===============华丽的分割线===============
今天在http://blog.vervestudios.co/blog/post/2011/05/13/IE9-Only-CSS-Hack.aspx上看到另一种hack:
01 | #element { |
02 | color :orange; |
03 | } |
04 | #element { |
05 | * color : white ; /* IE6+7, doesn't work in IE8/9 as IE7 */ |
06 | } |
07 | #element { |
08 | _color : red ; /* IE6 */ |
09 | } |
10 | #element { |
11 | color : green \ 0 /IE 8 + 9 ; /* IE8+9 */ |
12 | } |
13 | :root #element { color :pink \ 0 /IE 9 ; } /* IE9 */ |
声明: 本文采用 BY-NC-SA 协议进行授权 | WEB前端开发
转载请注明转自《IE9的css hack》