网页布局
头部为header
主体为main
底部为footer
<!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>网页结构</title>
<style>
header,main,footer{
margin: 0 auto;
width: 800px;
}
header{
height: 150px;
background-color: red;
}
main{
margin: 10px auto;
height: 600px;
background-color: #bfa;
}
nav,article,aside{
float: left;
height: 100%;
}
nav{
background-color: salmon;
width: 190px;
}
article{
background-color: sandybrown;
width: 400px;
margin: 0 10px;
}
aside{
background-color: salmon;
width: 190px;
}
footer{
height: 150px;
background-color: rosybrown;
}
</style>
</head>
<body>
<!-- 头部 -->
<header></header>
<!-- 主体 -->
<main>
<!-- 左侧部分 -->
<nav></nav>
<!-- 中间部分 -->
<article></article>
<!-- 右边部分 -->
<aside></aside>
</main>
<!-- 底部 -->
<footer></footer>
</body>
</html>
效果图