thinking

          one platform thousands thinking

          CSS hack:區(qū)分IE6,IE7,firefox

          CSS hack:區(qū)分IE6,IE7,firefox

          區(qū)別不同瀏覽器,CSS hack寫(xiě)法:


          區(qū)別IE6FF
                 background:orange;*background:blue;

          區(qū)別IE6IE7
                 background:green !important;background:blue;

          區(qū)別IE7FF
                 background:orange*background:green;

          區(qū)別FF,IE7IE6
                 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è),下劃線(xiàn)"_",
          IE6支持下劃線(xiàn),IE7和firefox均不支持下劃線(xiàn)。

          于是大家還可以這樣來(lái)區(qū)分IE6IE7firefox
          : background:orange;*background:green;_background:blue;

          注:不管是什么方法,書(shū)寫(xiě)的順序都是firefox的寫(xiě)在前面,IE7的寫(xiě)在中間,IE6的寫(xiě)在最后面。




          相關(guān):

          posted on 2010-02-10 16:14 lau 閱讀(437) 評(píng)論(2)  編輯  收藏 所屬分類(lèi): Web

          Feedback

          # re: CSS hack:區(qū)分IE6,IE7,firefox 2011-01-31 14:05 lau

          *對(duì)IE8不起作用  回復(fù)  更多評(píng)論   

          # re: CSS hack:區(qū)分IE6,IE7,firefox 2011-02-12 17:30 lau

          {

          background:orange; /*for all (包括FF)*/

          background:red\0; /*for ie8*/

          *background:green; /*for ie7,ie6*/

          _background:blue; /*for ie6 ,注意,這個(gè)會(huì)重寫(xiě)前面*background的樣式*/

          }
            回復(fù)  更多評(píng)論   

          主站蜘蛛池模板: 嘉善县| 千阳县| 尉氏县| 沐川县| 门头沟区| 杭州市| 会理县| 加查县| 安泽县| 漳浦县| 铁岭县| 广灵县| 泰顺县| 武陟县| 丰原市| 广州市| 安新县| 舞阳县| 青海省| 北票市| 增城市| 碌曲县| 孟连| 五河县| 新乡县| 西吉县| 阿图什市| 抚顺市| 四子王旗| 龙海市| 金山区| 永吉县| 龙江县| 乐清市| 新昌县| 达尔| 古蔺县| 宁乡县| 垦利县| 穆棱市| 建德市|