要分辨IE6和firefox兩種瀏覽器,,可以這樣寫: <style> div{ background:green; /* for firefox */ *background:red; /* for IE6 */ } </style> 在IE6中看到是紅色的,,在firefox中看到是綠色的,。 CSS hack:區(qū)分IE6,,IE7,,firefox 區(qū)別不同瀏覽器,,CSS hack寫法: 區(qū)別IE6與FF: background:orange;*background:blue; 區(qū)別IE6與IE7: background:green !important;background:blue; 區(qū)別IE7與FF: background:orange; *background:green; 區(qū)別FF,,IE7,IE6: background:orange;*background:green;_background:blue; background:orange;*background:green !important;*background:blue; 注:IE都能識(shí)別*;標(biāo)準(zhǔn)瀏覽器(如FF)不能識(shí)別*,; IE6能識(shí)別*,,但不能識(shí)別 !important, IE7能識(shí)別*,也能識(shí)別!important; FF不能識(shí)別*,,但能識(shí)別!important;
|