Bootstrap

实现三列等宽布局

实现三列等宽布局

<!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>
        .box{
            display: flex;
        }

        /* 这一步精髓 */
        .left,.right,.center{
            flex: 1;
        }

        .left{
            background-color: skyblue;
        }

        .right{
            background-color: yellow;
        }

        .center{
            background-color: wheat;
            height: 400px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="left"></div>
        <div class="center"></div>
        <div class="right"></div>
    </div>
</body>
</html>

欢迎交流

;