弹性盒子圣杯布局

<!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;
}

 

相关文章

一:display:flex布局display:flex是一种布局方式。它即可以...
1. flex设置元素垂直居中对齐在之前的一篇文章中记载过如何...
移动端开发知识点pc端软件和移动端apppc端软件是什么,有哪些...
最近挺忙的,准备考试,还有其他的事,没时间研究东西,快周...
display:flex;把容器设置为弹性盒模型(设置为弹性盒模型之后...
我在网页上运行了一个Flex应用程序,我想使用Command←组合键...