如何编辑代码成以下样式

来源:14-1 弹性盒模型 - 弹性盒模型之flex属性

WuliZhuer

2020-05-20 18:23

http://img3.mukewang.com/5ec504db0001fe7204540340.jpg完整HTML样式

写回答 关注

3回答

  • weixin_慕仰9011665
    2020-05-22 17:16:16

    多定义几个div,应该可以,全部用一个div,上面和下面都在第一个div里面重新定义不同的div,中间的做一个div,中间的在分成三个div,在细分,就可以了,自己去尝试吧。

  • 慕侠5052482
    2020-05-22 10:41:37

    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="utf-8">

    <title></title>

    <style>

    body{

    }

    .div0{

    margin: 0 auto;

    width: 80%;

    background-color: #ccc;

    }

    .divTop{

    height: 200px;

    background-color: springgreen;

    }

    .divCenter{

    height: 500px;

    background-color: green;

    display: flex;

    }

    .divBottom{

    height: 200px;

    background-color: springgreen;

    }

    .divCLeft{

    flex: 1;

    background-color: yellow;

    }

    .divCCenter{

    flex: 2;

    background-color: orange;

    }

    .divCRight{

    flex: 1;

    background-color: deeppink;

    }

    .divCLeft1{

    height: 100px;

    background-color:red;

    }

    .divCLeft2{

    height: 100px;

    background-color: skyblue;

    }

    .divCLeft3{

    height: 100px;

    background-color: lawngreen;

    }

    .divCLeft4{

    height: 200px;

    background-color: palevioletred;

    }

    </style>

    </head>

    <body>

    <div class="div0">

    <div class="divTop">

    </div>

    <div class="divCenter">

    <div class="divCLeft">

    <div class="divCLeft1">

    </div>

    <div class="divCLeft2">

    </div>

    <div class="divCLeft3">

    </div>

    <div class="divCLeft4">

    </div>

    </div>

    <div class="divCCenter">

    </div>

    <div class="divCRight">

    </div>

    </div>

    <div class="divBottom">

    </div>

    </div>

    </body>

    </html>


  • 慕侠5052482
    2020-05-22 10:40:39

    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="utf-8">

    <title></title>

    <style>

    body{

    }

    .div0{

    margin: 0 auto;

    width: 80%;

    background-color: #ccc;

    }

    .divTop{

    height: 200px;

    background-color: springgreen;

    }

    .divCenter{

    height: 500px;

    background-color: green;

    display: flex;

    }

    .divBottom{

    height: 200px;

    background-color: springgreen;

    }

    .divCLeft{

    flex: 1;

    background-color: yellow;

    }

    .divCCenter{

    flex: 2;

    background-color: orange;

    }

    .divCRight{

    flex: 1;

    background-color: deeppink;

    }

    .divCLeft1{

    height: 100px;

    background-color:red;

    }

    .divCLeft2{

    height: 100px;

    background-color: skyblue;

    }

    .divCLeft3{

    height: 100px;

    background-color: lawngreen;

    }

    .divCLeft4{

    height: 200px;

    background-color: palevioletred;

    }

    </style>

    </head>

    <body>

    <div class="div0">

    <div class="divTop">

    </div>

    <div class="divCenter">

    <div class="divCLeft">

    <div class="divCLeft1">

    </div>

    <div class="divCLeft2">

    </div>

    <div class="divCLeft3">

    </div>

    <div class="divCLeft4">

    </div>

    </div>

    <div class="divCCenter">

    </div>

    <div class="divCRight">

    </div>

    </div>

    <div class="divBottom">

    </div>

    </div>

    </body>

    </html>


初识HTML(5)+CSS(3)-升级版

HTML(5)+CSS(3)基础教程8小时带领大家步步深入学习标签用法和意义

1225813 学习 · 18234 问题

查看课程

相似问题