CSS-04:利用类选择器画三个盒子

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>利用类选择器画三个盒子</title>
    <style>
        .red {
      
      
            width: 100px;
            height: 100px;
            /* 背景颜色 */
            background-color: red;
        }

        .green {
      
      
            width: 100px;
            height: 100px;
            background-color: green;
        }

        .yellow {
      
      
            width: 100px;
            height: 100px;
            background-color: yellow;
        }
    </style>
</head>

<body>
    <div class="red">红色</div>
    <div class="green">绿色</div>
    <div class="yellow">黄色</div>
</body>

</html>

猜你喜欢

转载自blog.csdn.net/chuan0106/article/details/125544894
今日推荐