Css查漏补缺01—css样式

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>css样式</title>
<!-- 1.标签选择器
     2.类选择器
     3.子选择器
     4.交集选择器-->
    <style>
         p{
            font-size:40px;
            color:blue;

        }

        .css1{
            color:red;
        }

        div>p{
            color:yellow;
        }

        div.aaa{
            color:green;
            letter-spacing:normal;
            word-spacing:normal;
            line-height:normal;
        }
    </style>
    <link rel="stylesheet" href="css1.css">
</head>
<body>
<!--(1) 不要去试图用一个类名,把某个标签的所有样式写完。这个标签要多携带几个类, 共同完成这个标签的样式。-->
<!--(2)每一个类要尽可能小,有“公共”的概念,能够让更多的标签使用。-->

    <p>自律使人自由1</p>
    <p class="css1">自律使人自由2</p>
    <div>
        <p>自律使人自由3</p>
    </div>
    <div class="aaa" style="font-size:40px;">
        自律使人自由4
    </div>

    <div class="aaa" style="font-size:40px;">
        Self discipline makes people free
    </div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/cuijunfeng/p/13174622.html