微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

弹性盒子圣杯布局

<!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>Document</title>
    <link rel="stylesheet" href="./css/index.css">
</head>
<body>
    <header></header>
    <div class="body">
        <nav></nav>
        <section></section>
        <aside></aside>
    </div>
    <footer></footer>
</body>
</html>
*{
    margin: 0;
    padding: 0;
    list-style: none;
}

header,
footer {
    height: 50px;
    background-color: aquamarine;
}

header {
    flex: 0 0 60px;
}

footer {
    flex: 0 0 40px;
}
html {
    height: 100%;
}
body {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.body {
    flex: 1;
    display: flex;
}

nav,
aside {
    flex: 0 0 150px;
}

section {
    flex: 1;
    background-color: blueviolet;
}

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐