區別不同瀏覽器,CSS hack寫法

2021-09-30 06:57:00 字數 815 閱讀 1001

區別

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;

ie6ie7ff*

√√×!important×√

√ 另外再補充乙個,下劃線"_",

ie6支援下劃線,ie7和firefox均不支援下劃線。

於是大家還可以這樣來區分ie6,ie7,firefox

: background:orange;*background:green;_background:blue;

注:不管是什麼方法,書寫的順序都是firefox的寫在前面,ie7的寫在中間,ie6的寫在最後面。

區別不同瀏覽器,CSS hack寫法

區別 ie6 與 ff background orange background blue 區別 ie6 與 ie7 background green important background blue 區別 ie7 與 ff background orange background green 區...

區別不同瀏覽器,CSS hack寫法

區別 ie6與 ff background orange background blue 區別 ie6與 ie7 background green important background blue 區別 ie7與 ff background orange background green 區別 f...

區別不同瀏覽器,CSS hack寫法!

區別ie6與ff background orange background blue 區別ie6與ie7 background green important background blue 區別ie7與ff background orange background green 區別ff,ie7,i...