CSS hack:区分IE6 IE7 Firefox
生活随笔
收集整理的這篇文章主要介紹了
CSS hack:区分IE6 IE7 Firefox
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
區(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?!important;*background:blue;
注:IE都能識(shí)別*;標(biāo)準(zhǔn)瀏覽器(如FF)不能識(shí)別*; IE6能識(shí)別*,但不能識(shí)別 !important, IE7能識(shí)別*,也能識(shí)別!important; FF不能識(shí)別*,但能識(shí)別!important;
| IE6 | IE7 | FF | |
| * | √ | √ | × |
| !important | × | √ | √ |
另外再補(bǔ)充一個(gè),下劃線"_",
IE6支持下劃線,IE7和firefox均不支持下劃線。
于是大家還可以這樣來區(qū)分IE6,IE7,firefox
: background:orange;*background:green;_background:blue;
注:不管是什么方法,書寫的順序都是firefox的寫在前面,IE7的寫在中間,IE6的寫在最后面。
轉(zhuǎn)載于:https://www.cnblogs.com/yongzhi/articles/1187207.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的CSS hack:区分IE6 IE7 Firefox的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。