區別 IE6 與 FF:
background:orange;*background:blue;
區別 IE6 與 IE7:
background:green !important;background:blue;
區別 IE7 與 FF:
background:orange; *background:green;
區別 FF、IE7、IE6:
background:orange;*background:green !important;*background:blue;
注:IE 都能識別 *;標準瀏覽器(如 FF)不能識別 *;
IE6 能識別 *,但不能識別 !important,
IE7 能識別 *,也能識別 !important;
FF 不能識別 *,但能識別 !important。
對照表:
IE6 IE7 FF
* √ √ ×
!important × √ √
另外再補充一個:下劃線"_"。IE6 支援下劃線,IE7 和 Firefox 均不支援(推薦)。
於是大家還可以這樣來區分 IE6、IE7、Firefox:
: background:orange;*background:green;_background:blue;
注:不管是什麼方法,書寫的順序都是 Firefox 的寫在前面,IE7 的寫在中間,IE6 的寫在最後面。