<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
* {
padding: 0;
margin: 0;
}
.top {
height:50px ;
background-color: slategray;
}
.banner {
height: 100px;
width:830px;
margin: 10px auto;
background-color: slategray ;
}
.box {
height: 200px;
width: 830px;
background-color:pink;
margin: 10px auto;
}
.box>div {
background-color: slategray;
height: 200px;
width: 200px;
margin-right: 10px;
float: left;
}
.footer {
height:150px ;
background-color: slategray;
}
.box .last {
height: 200px;
width: 200px;
float: left;
background-color: slategray ;
margin-right: 0px;
}
</style>
<body>
<div class="top">top</div>
<div class="banner">banner</div>
<div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
<div class="last">4</div>
</div>
<div class="footer">footer</div>
</body>
</html>
效果图: