【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:red\9;                    /*all IE*/
            background-color:yellow\0;                /*IE8*/
            *background-color:pink;                    /*IE7 +也能区分IE7和其他浏览器*/
            _background-color:orange;                /*IE6 区分IE6还可以用!important*/
        }
        :root #doc { background-color:purple\9; }    /*IE9*/
        @media all and (min-width:0px){ #doc {background-color:black\0;} }                        /*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>

 

posted on 2014-01-17 23:28  毛毛_Roc  阅读(210)  评论(0编辑  收藏  举报

导航