thinking

          one platform thousands thinking

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

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

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


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

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

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

          區(qū)別FFIE7IE6
                 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均不支持下劃線。

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

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




          相關(guān):

          posted on 2010-02-10 16:14 lau 閱讀(447) 評(píng)論(2)  編輯  收藏 所屬分類: 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ì)重寫前面*background的樣式*/

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

          主站蜘蛛池模板: 肇州县| 东丽区| 安仁县| 娱乐| 阿拉善盟| 珠海市| 长武县| 界首市| 巴青县| 临潭县| 建湖县| 桐城市| 蛟河市| 辽宁省| 阿拉善右旗| 玉屏| 韩城市| 丹寨县| 阿图什市| 科技| 辛集市| 巧家县| 莲花县| 东台市| 清涧县| 宜川县| 金阳县| 山东省| 南开区| 高州市| 法库县| 米易县| 永济市| 张家界市| 上饶县| 曲水县| 哈巴河县| 宜阳县| 梧州市| 周至县| 惠水县|