效果图:
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/3350c2c6b2f8005a6a18f2de5c7f92fa.png)
知识点
- 浮动:float
- 网页布局要素(一般有top、banner、box等)
- 给元素取名字
- 顶层大元素一般是标准流,大元素里面包着浮动元素
- 隐藏列表前面的小黑点:liststyle: none
代码
<!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>buju</title>
<style>
* {
margin: 0;
padding: 0;
}
.top {
height: 90px;
background-color: coral;
}
.banner {
height: 300px;
background-color: burlywood;
margin: 60px 48px;
}
.box {
height: 200px;
background-color: rgb(218, 218, 218);
margin: 60px 48px;
}
li {
list-style: none;
}
.listbox li {
float: left;
width: 15%;
height: 180px;
background-color: aquamarine;
margin-left: 16px;
margin-right: ppx;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="top">top</div>
<div class="banner">banner</div>
<div class="box">
<ul class="listbox">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
</div>
</body>
</html>