HTML5色块练习

练习一

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
     
            margin: 0;
            padding: 0;
        }
        .content{
     
            width: 100%;
        }
        .header{
     
            width: 100%;
            height: 60px;
            background-color: #232323;
        }
        .header-cloumn{
     
            height: 60px;
            width: 64%;
            margin: 0 auto;
            background-color: #e24a15;
        }
        .advertising{
     
            width: 100%;
            height: 400px;
            background-color: #67cc75;
        }
        .floor1{
     
            width: 100%;
            height: 350px;
            background-color: #f5f5f5;
        }
        .floor1-content{
     
            width: 64%;
            height: 350px;
            margin: 0 auto;
            display: flex;
        }
        .floor1-content div{
     
            width: 25%;
            height: 100%;
        }
        .floor1-content>:nth-child(1){
     
            background-color: #333;
        }
        .floor1-content>:nth-child(2){
     
            background-color: #fdc07c;
        }
        .floor1-content>:nth-child(3){
     
            background-color: #8adec9;
        }
        .floor1-content>:nth-child(4){
     
            background-color: #a9d7f9;
        }
        .floor2{
     
            width: 100%;
            height: 280px;
            background-color: #fff;
        }
        .floor2-content{
     
            width: 64%;
            height: 230px;
            padding: 25px 0;
            margin: 0 auto;
            display: flex;
        }
        .floor2-content>:nth-child(1){
     
            width: 30%;
            height: 100%;
            background-color: #e57c7c;
        }
        .floor2-content>:nth-child(2){
     
            width: 38%;
            height: 100%;
            background-color: #7e7ce5;
            margin-left: 2%;
        }
        .floor2-content>:nth-child(3){
     
            width: 38%;
            height: 100%;
            background-color: #a9d7f9;
            margin-left: 2%;
        }
        .floor3{
     
            width: 100%;
            height: 200px;
            background-color: #222222;
        }
        .floor3-cloumn{
     
            width: 64%;
            height: 100%;
            margin: 0 auto;
            display: flex;
        }
        .floor3-cloumn>:nth-child(1){
     
            width: 40%;
            height: 100%;
            background-color: #a9d7f9;
        }
        .floor3-cloumn>:nth-child(2){
     
            width: 34%;
            height: 100%;
            background-color: #f9a9e9;
            margin-left: 4%;
        }
        .floor3-cloumn>:nth-child(3){
     
            width: 20%;
            height: 100%;
            background-color: #8c87f6;
            margin-left: 2%;
        }
        .footer{
     
            width: 100%;
            height: 50px;
            background-color: #101010;
        }
        .footer-cloumn{
     
            width: 64%;
            height: 100%;
            margin: 0 auto;
            background-color: #87a7f6;
        }
    </style>
</head>
<body>
    <div class="content">
        <div class="header">
            <div class="header-cloumn">
            </div>
        </div>
        <div class="advertising">
        </div>
        <div class="floor1">
            <div class="floor1-content">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>
        <div class="floor2">
            <div class="floor2-content">
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>
        <div class="floor3">
            <div class="floor3-cloumn">
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>
        <div class="footer">
            <div class="footer-cloumn">
            </div>
        </div>
    </div>
</body>
</html>

练习二

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值