DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> CSS入門知識 >> DIV十CSS布局 >> 布局實例
如何區分IE6、IE7與Firefox的CSS Hack
編輯:布局實例     

區別 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 的寫在最後面。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved