第四篇、CSS选择器

 

<html>
    <head>
        <meta charset="UTF-8">
        <title>CSS选择器</title>
        
        <!--页内样式-->
        <style>
            /*body{
                background-color:red;
            }*/
            
            /* 类选择器
            .box1{
                background-color:yellow;
            }*/
            
            /* id选择器 特殊定义样式*/
            #box2{
                font-size:50px;
            }
            
            /* 并列选择器
            body,.box1{
            }
            */
            
            /* 复合选择器
            body.box1{
            }
            */
            
            /* 后代选择器(常用)
            */
            .box1{
                color:red;
            }
            
            
        </style>
    </head>
    
    <body>
    
        <!--class 类选择器-->
        <div class="box1">11111111111111111111111111111111111</div>
        <div id="box2">2222222222222222222222222222222222</div>
        <div>333333333333333333333333333333333333</div>
    </body>
</html>

 

posted on 2016-09-01 23:37  久冬不雨  阅读(132)  评论(0编辑  收藏  举报