CSS 选择器优先级问题

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        div.tc{ background-color:Orange;}
        .tc{ background-color: Black;}
        div
        {
            background-color: Red;
        }        
        #t1{ background-color:Purple;}
    </style>
</head>
<body>
    <div id="t1" class="tc">
        afdasfdsafd
    </div>
</body>
</html>

得出的结论是: id > div.class > .class > div

posted on 2013-08-22 17:28  Gcam  阅读(111)  评论(0编辑  收藏  举报

导航