CSS练习3
京东轮播图
效果截图
代码部分
无轮播js待完善。。。
<!DOCTYPE html>
<html lang="ch">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
li{
margin: 0;
padding: 0;
list-style: none;
position: absolute;
}
/* 设置图片容器 */
.image{
width: 590px;
height: 470px;
margin:20px auto;
position: relative;
}
/* 通过设置层级显示指定图片 */
.image li:nth-child(3){
z-index: 1;
}
img{
width: 100%;
height: 100%;
}
/* 导航点样式 */
.point{
position: absolute;
z-index: 99;
bottom: 10px;
left: 20px;
}
.point a{
width: 10px;
height: 10px;
background-color: rgba(255, 255, 255, 0.6);
border: 2px solid transparent;
/* 元素向左浮动,从而水平排列 */
float: left;
border-radius: 50%;
margin: 0 3px;
/* 将背景颜色设置到内容区,使边框和内边距无背景色*/
background-clip: content-box;
}
.point a.active,
.point a:hover{
background-color: white;
border: 2px solid rgba(255, 255, 255, 0.6);
}
</style>
</head>
<body>
<div class="box">
<div class="image">
<li><a href="javascript:;"><img src="./05/1.jpg" alt=""></a></li>
<li><a href="javascript:;"><img src="./05/2.jpg" alt=""></a></li>
<li><a href="javascript:;"><img src="./05/3.jpg" alt=""></a></li>
<li><a href="javascript:;"><img src="./05/4.jpg" alt=""></a></li>
<li><a href="javascript:;"><img src="./05/5.jpg" alt=""></a></li>
<li><a href="javascript:;"><img src="./05/6.jpg" alt=""></a></li>
<li><a href="javascript:;"><img src="./05/7.jpg" alt=""></a></li>
<li><a href="javascript:;"><img src="./05/8.jpg" alt=""></a></li>
<div class="point">
<a class="active" href="javascript:;"></a>
<a href="javascript:;"></a>
<a href="javascript:;"></a>
<a href="javascript:;"></a>
<a href="javascript:;"></a>
<a href="javascript:;"></a>
<a href="javascript:;"></a>
<a href="javascript:;"></a>
</div>
</div>
</div>
</body>
</html>