比如轮播图中的分页按钮
/* 弹性盒 */
/* .box{
width: 300px;
height: 150px;
background-color: aqua;
display: flex;
justify-content: center;
align-items: flex-end;
}
.box div{
width: 30px;
height: 30px;
background-color: blueviolet;
border-radius: 50%;
margin: 10px;
} */
结构:
<!-- <div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
<div>1</div>
<div>2</div>
<div>3</div>
</div> -->
/* 普通方法 */
.box{
width: 300px;
height: 150px;
background-color: aqua;
position: relative;
}
.box section{
text-align: center;
width: 100%;
position: absolute;
bottom: 0;
}
.box div{
width: 30px;
height: 30px;
background-color: blueviolet;
border-radius: 50%;
display: inline-block;
margin: 5px;
}
结构:
<div class="box">
<section>
<div>1</div>
<div>2</div>
<div>3</div>
<div>1</div>
<div>2</div>
<div>3</div>
</section>
</div>