1-移动端felx 圣杯布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>flex 圣杯布局</title>
    <style>
        html,body,header,main,footer{
            padding: 0;
            margin: 0;
        }
        body,html{
            display: flex;
            flex-direction: column;
            height: 100%;
        }
        header{
            flex: 0 0 60px;
            background-color: green;
        }

        footer{
            flex: 0 0 40px;
            background-color: green;
        }
        main{
            flex: 1;
            display: flex;
        }
        nav,aside{
            flex: 0 0 150px;
            background-color: aqua;
        }

        section{
            flex: 1;
            background-color: antiquewhite;
            display: flex;
            justify-content: center;
            height: 100%;
            align-items: center;
        }
![1114.jpg](https://upload-images.jianshu.io/upload_images/12675829-304762c023a7f2a8.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
        .box{
            width: 100px;
            height: 100px;
            background-color: red;
            margin: 0 2px;
        }


    </style>
</head>
<body>
    <header></header>
    <main>
        <nav></nav>
        <section>
            <div class="box"></div>
            <div class="box"></div>
            <div class="box"></div>
        </section>
        <aside></aside>
    </main>
    <footer></footer>
</body>
</html>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容