*background:blue; // IE6
background:blue; // IE6
*background:blue; // IE7
*background:green !important; // IE7
*background:blue; // IE6
注:IE都能識別*;標準瀏覽器(如FF)不能識別*;
IE6 | IE7 | FF | |
* | √ | √ | × |
!important | × | √ | √ |
方法二:
利用下劃線"_",IE6支持下劃線,IE7和firefox均不支持下劃線。於是大家還可以這樣來區分IE6,IE7,firefox
*background:green; //IE7
_background:blue; //IE6
注:不管是什麼方法,書寫的順序都是firefox的寫在前面,IE7的寫在中間,IE6的寫在最後面。