实现效果:
代码:
<!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>Document</title>
<style>
* {
padding: 0px;
margin: 0px;
box-sizing: border-box;
}
li{
list-style: none;
}
.tb-promo {
position: relative;
width: 520px;
height: 280px;
background-color: pink;
margin: 0px auto;
}
.tb-promo img {
width: 100%;
}
.prev,
.next {
display: none;
position: absolute;
top: 50%;
margin-top: -15px;
width: 20px;
height: 30px;
background: rgba(100, 100, 100, 0.5);
color: white;
line-height: 30px;
}
.prev {
left: 0;
border-radius: 0px 30px 30px 0;
}
.next {
right: 0;
border-radius: 30px 0 0 30px;
text-indent: 0.5em;
}
.tb-promo:hover .prev{
display: block;
}
.tb-promo:hover .next{
display: block;
}
.bottom{
position: absolute;
bottom: 10px;
left: 50%;
margin-left: -40px;
width: 80px;
height: 20px;
background: rgba(255, 255, 255, 0.3);
border-radius: 10px;
}
.bottom li{
float: left;
width: 10px;
height: 10px;
background-color: white;
border-radius: 10px;
margin-left: 5px;
margin-top: 5px;
}
.bottom li:nth-child(1){
background-color: #FF5000;
}
</style>
</head>
<body>
<div class="tb-promo">
<img src="https://gtms01.alicdn.com/tps/i1/TB1r4h8JXXXXXXoXXXXvKyzTVXX-520-280.jpg" alt="">
<div class="prev"><</div>
<div class="next">></div>
<div class="bottom">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
</body>
</html>