练习5:轮播图布局
作者:互联网
<!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>
</head>
<style>
.box{
margin: 100px auto;
width: 300px;
height: 300px;
position: relative;
}
.box img{
width: 300px;
height: 300px;
position: absolute;
}
.box img:nth-child(3){
z-index: 1;
}
.box1{
position: absolute;
z-index: 9999;
/* 子绝父相 */
bottom: 20px;
}
.box1 a{
margin-left: 5px;
float: left;
width: 5px;
height: 5px;
border-radius: 50%;
background-color: rgba(52, 73, 73, 0.3);
/* 将背景颜色设置到内容区,边框和内边距都不在背景颜色内 */
background-clip: content-box;
border: solid 2px transparent;
}
a.active{
background-color: rgb(231, 47, 47);
border: solid 2px rgba(4, 159, 159, 0.3);
}
</style>
<body>
<div class="box">
<img src="../p1.jpg" >
<img src="../p2.jpg" >
<img src="../p3.jpg" >
<img src="../p4.jpg" >
<img src="../p5.jpg" >
<div class="box1">
<a class="active" href=""></a>
<a href=""></a>
<a href=""></a>
<a href=""></a>
<a href=""></a>
</div>
</div>
</body>
</html>
标签:box,练习,轮播,布局,300px,height,width,5px,border 来源: https://www.cnblogs.com/evelei/p/16188490.html