thinking

          one platform thousands thinking

          CSS hack:區分IE6,IE7,firefox

          CSS hack:區分IE6,IE7,firefox

          區別不同瀏覽器,CSS hack寫法:


          區別IE6FF
                 background:orange;*background:blue;

          區別IE6IE7
                 background:green !important;background:blue;

          區別IE7FF
                 background:orange*background:green;

          區別FFIE7IE6
                 background:orange;*background:green !important;*background:blue;

          注:IE都能識別*;標準瀏覽器(如FF)不能識別*;
          IE6能識別*,但不能識別 !important,
          IE7能識別*,也能識別!important;
          FF不能識別*,但能識別!important;


          IE6 IE7 FF
          * ×
          !important ×

          _ × ×

          #
          × ×


          另外再補充一個,下劃線"_",
          IE6支持下劃線,IE7和firefox均不支持下劃線。

          于是大家還可以這樣來區分IE6IE7firefox
          : background:orange;*background:green;_background:blue;

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




          相關:

          posted on 2010-02-10 16:14 lau 閱讀(446) 評論(2)  編輯  收藏 所屬分類: Web

          Feedback

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

          *對IE8不起作用  回復  更多評論   

          # re: CSS hack:區分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 ,注意,這個會重寫前面*background的樣式*/

          }
            回復  更多評論   

          主站蜘蛛池模板: 淮滨县| 石泉县| 徐水县| 宜丰县| 晋州市| 滨海县| 兰州市| 鄂温| 北票市| 铜梁县| 综艺| 绍兴县| 长宁区| 海南省| 米泉市| 偏关县| 黄山市| 泗水县| 海伦市| 葵青区| 疏附县| 阿拉尔市| 读书| 佛坪县| 定远县| 大兴区| 青州市| 麻阳| 南阳市| 包头市| 呼图壁县| 马山县| 朝阳县| 潍坊市| 南丹县| 舒兰市| 长丰县| 舞阳县| 新乡县| 荥经县| 彭州市|