区分IE全系列的css hack
时间:2011-06-01 来源:司徒正美
/*  by  司徒正美 2011.6.1*/
      #element {
        background:orange;/* FF4 safari5 */
      }
      #element {
        -background: red;     /* IE6 */
      }
      #element {
        *background: blue;    /* IE7*/
      }
      #element {
        background: green\0; /* IE8  opera11 */
      }
      :root #element { background:pink\9; }  /* IE9 */
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>区分IE全系列CSS hack by 司徒正美</title> <style> #element { background:orange;/* FF4 safari5 */ } #element { -background: red; /* IE6 */ } #element { *background: blue; /* IE7*/ } #element { background: green\0; /* IE8 opera11 */ } :root #element { background:pink\9; } /* IE9 */ </style> </head> <body> <h1>区分IE全系列CSS hack by 司徒正美</h1> <div id="element"> 测试 </div> </body> </html>
运行代码
 相关阅读 更多 + 
    
  









