<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
padding: 0px;
margin: 0px;
}
html,body{
height: 100%; /*一定要将height在这里设置为100%,否则不会显示*/
}
body{
display: flex;
flex-direction: column;
}
header{
flex: 0 0 140px;
background-color: #EE82EE;
}
footer{
flex: 0 0 120px;
background-color: #AFEEEE;
}
main{
flex: 1;
display: flex;
}
nav , aside{
background-color: #F5DEB3;
flex: 0 0 100px;
}
section{
background-color: #7FFFD4;
flex: 1;
display: flex; /*让蓝色的盒子水平居中对齐 */
align-items: center;
justify-content: center;
}
.box{
height: 100px;
width: 100px;
background-color: #0000FF;
}
/*要找准父盒子与子盒子,还有他们之间的关系*/
</style>
</head>
<body>
<header>
</header>
<main>
<nav></nav>
<section>
<div class="box">
</div>
</section>
<aside></aside>
</main>
<footer>
</footer>
</body>