ie6 ie7 ie8 ie9 ff css 區別

來源:互聯網
上載者:User
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>css 區別ie6 ie7 ie8 ie9 ff</title><style type="text/css">div{ width:500px; height:300px;  border:1px solid #f00; margin:0px auto;}.info{ /* background:#000!important\0 ||  background:#000!important\0\9 ie6識別  ff ie7 ie8 ie9 不識別*/ /*background:#000!important   ie6 ff ie7 ie8 ie9 識別 */ /*background:#000;  ie6 ff ie7 ie8 ie9 識別 */ /*background:#000\0;  ie6 ff ie7 不識別 ie8 ie9 識別 */ /*background:#000\9;  ie6 ie7 ie8 ie9 識別 ff不識別 */ /*background:#000\9;  ie6 ie7 ie8 ie9 識別 ff不識別 */ /*background:#000\0\9; ie6 ie7 ff 不識別 ie8 ie9 識別*/ /* *background:#000; ie6 ie7識別 ie8 ie9 ff 不識別*/ /* *_background:#000; _background:#000; ie6 識別ie7 ie8 ie9 ff 不識別*/background:#FF0; /* ff */ /*黃色*/background:#0F0\9;/* ie 8 ie 9*//*綠色*/ *background:#F00;/*ie 6 ie 7*/ /* 紅色*/_background:#00F; /*ie 6*/ /*藍色*/}</style><!--[if IE 8]><style type="text/css">.info{background:#000;}</style> <![endif]--> </head> <body>  <div class="info">      可以用 \0 \9 來表示ie8 和ie9<br>      可以用 * 區別 IE7<br>      可以用 _ 區別 ie6<br>      但最後無法 區別IE8 ie9<br>      所以值能用<!--[if IE 8]> ie8 樣式<![endif]-->      一定要放在最後      如果各位有更好的辦法或哪裡寫的有誤,請在評論中註明  </div></body></html> 轉自:http://www.cnblogs.com/tongchuanxing/archive/2012/05/28/2521425.html
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.