运行代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
#a {
width: 400px;
height: 250px;
margin: 0 auto;
}
img {
width: 400px;
height: 250px;
}
ul {
margin: 0 auto;
margin-top: -38px;
width: 300px;
list-style: none;
display: flex;
justify-content: space-between;
}
li {
display: inline-block;
width: 20px;
height: 20px;
border-radius: 50%;
background: rgba(0, 0, 0, 0.3);
}
.xz {
background-color: red;
}
</style>
</head>
<body>
<div id="a">
<img src="img/bg1.jpg">
<ul>
<li class="xz"></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</