天天看點

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>

無需多言,就是友善。      
下一篇: flex 居中