css flex实现经典的三栏布局

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>flex 三栏式布局</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .wrapper{
            display: flex;
            display: -webkit-flex;
            display: -moz-flex;
            flex-direction: row;
            width: 600px;
            height: 200px;
            box-sizing: border-box;
            border: 1px solid red;
            margin: 0 auto;
        }
        .middle{
            flex: 1;
            height: 150px;
            background-color: gold;
        }
        .left{
            flex-basis: 100px;
            order: -1;
            height: 170px;
            background-color: skyblue;
        }
        .right{
            flex-basis: 100px;
            height: 170px;
            background-color: purple;
        }
    </style>
</head>
<body>

<div class="wrapper">
    <div class="middle">中间布局</div>
    <div class="left">左侧布局</div>
    <div class="right">右侧布局</div>
</div>
</body>
</html>
    原文作者:oneblue123
    原文地址: https://blog.csdn.net/oneblue123/article/details/79271340
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞