flex弹性盒子布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>flex</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        body{
            background-color: red;
        }
        .container{
            width: 100%;
            min-height: 500px;
            background-color: yellowgreen;
            display: flex;
        }
        .container .left{
            width: 200px;
            height: 500px;
            background-color: purple;
        }
        .container .right{
            width: 150px;
            height: 500px;
            background-color: blue;
        }
        .container .center{
            flex-grow: 1;
            height: 500px;
            background-color: orange;
        }
    </style>
</head>
<body>
<div class="container">
   <div class="left"></div>
   <div class="center"></div>
   <div class="right"></div>
</div>
</body>
</html>

无需多言,就是方便。

 

posted @ 2019-08-18 16:00  菜鸟小何  阅读(226)  评论(0编辑  收藏  举报