这节没什么新知识,就直接放结果和代码了。
html:
<div class="banner">
<div class="imgs">
<a href=""><img src="./img/1.jpg" alt=""></a>
<a href=""><img src="./img/2.jpg" alt=""></a>
<a href=""><img src="./img/3.jpg" alt=""></a>
</div>
<div class="left"><</div>
<div class="right">></div>
<div class="modal">
<div class="title">
<h2>长春冰雪新天地开门迎客</h2>
</div>
<div class="dots">
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
</div>
css
.banner{
width: 520px;
height: 304px;
margin: 1em auto;
overflow: hidden;
position: relative;
}
.banner .imgs{
width: 1560px;
height: 304px;
}
.banner .imgs img{
width: 520px;
height: 304px;
}
.banner .imgs a{
float: left;
}
.banner .left,
.banner .right{
position: absolute;
width: 50px;
height: 50px;
line-height: 50px;
color: #fff;
font-size: 3em;
top: 0;
bottom: 0;
margin: auto;
text-align: center;
font-family: Arial;
border-radius: 50%;
cursor: pointer;
}
.banner .left:hover,
.banner .right:hover{
background: #fff;
color: red;
}
.banner .left{
left: 20px;
}
.banner .right{
right: 20px;
}
.banner .modal{
width: 100%;
height: 40px;
line-height: 40px;
background: rgba(129, 76, 76, 0.3);
position: absolute;
left: 0;
bottom: 0;
color: #fff;
padding: 0 20px;
box-sizing: border-box;
}
.banner .modal .title{
float: left;
font-weight: bold;
}
.banner .modal .dots{
float: right;
}
.banner .modal .dots li{
width: 8px;
height: 8px;
background: #ccc;
border-radius: 50%;
display: inline-block;
margin: 0 2px;
cursor: pointer;
}
.banner .modal .dots li:hover{
background: #369;
}