做了一个骚操作 ,给父标签加了一个overflow:hidden;
.labelBox {
width: 100%;
height: 50%;
position: absolute;
z-index: 3;
bottom: 0;
overflow: hidden;
left: 0;
.labelItem {
position: absolute;
bottom: 0%;
opacity: 0;
height: 0.72rem;
animation-iteration-count: infinite!important;
&:nth-child(6) {
left: 0.22rem;
animation: opacityChange 5s ease-out 0s;
}
}
}
@keyframes opacityChange {
0% {
bottom: 0%;
opacity: 0.8;
}
100% {
bottom: 100%;
opacity: 0;
}
}