【CSS】之hack

<!DOCTYPE HTML>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="keywords" content="keywords in here">
    <meta name="description" content="Description in here">
    <meta property="og:title" content="title">
    <meta property="og:description" content="Description in here">
    <title>Hack</title>
    <style>
        #doc{
            width:300px;
            height:300px;

            background-color:blue;                    /*firefox*/
            background-color:red9;                    /*all IE*/
            background-color:yellow;                /*IE8*/
            *background-color:pink;                    /*IE7 +也能区分IE7和其他浏览器*/
            _background-color:orange;                /*IE6 区分IE6还可以用!important*/
        }
        :root #doc { background-color:purple9; }    /*IE9*/
        @media all and (min-0px){ #doc {background-color:black;} }                        /*opera,无效,跟Chrome一样的引擎,所以颜色也一样*/
        @media screen and (-webkit-min-device-pixel-ratio:0){ #doc {background-color:gray;} }    /*chrome and safari*/
    </style> 
</head>
<body>
    <div id="doc">
        <!-- Document Content Start -->

        <!-- Document Content End   -->
    </div>
</body>
</html>
原文地址:https://www.cnblogs.com/maomaoroc/p/3524683.html