1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Css Hack</title> 5 <style> 6 #test 7 { 8 300px; 9 height:300px; 10
11 background-color:blue; /*firefox*/ 12 background-color:red9; /*all ie*/ 13 background-color:yellow ; /*ie8*/ 14 +background-color:pink; /*ie7*/ 15 _background-color:orange; /*ie6*/
*display : ie6,ie7
16 } 17 :root #test { background-color:purple9; } /*ie9*/ 18 @media all and (min-0px){ #test {background-color:black ;} } /*opera*/ 19 @media screen and (-webkit-min-device-pixel-ratio:0){ #test {background-color:gray;} } /*chrome and safari*/ 20 </style> 21 </head> 22 <body> 23 <div id="test">test</div> 24 </body> 25 </html>