CSS Class 选择器

CSS Class 选择器

再<stype>标签内,通过class属性来对标签进行css样式配置

<html>
<head>
    <!-- style 设置头部标签-->
    <style>
         /*.c1 添加样式 */
        .c1{
            background-color: #2459a1;
            height: 10px;
        }
    </style>
</head>
<body>
     <!-- class="c1" 引用c1样式 class可多次引用相同样式-->
    <div class="c1">1</div>
    <div class="c1">1</div>
</body>
</html>

:class选择器用的比较多,其他可根据场合使用。

 

posted @ 2019-02-21 14:16  kevin.Xiang  阅读(1212)  评论(0编辑  收藏  举报