html
<p>
<span class="ani"
swiper-animate-effect="dayin"
swiper-animate-duration="2s"
swiper-animate-delay="0.5s"
><b>2020</b>年,对公司和个人而言都注定是值得铭记的一年。</span>
</p>
css
.dayin{
opacity:0;
-webkit-animation: dy 3s steps(100, end) both;
animation: dy 3s steps(100, end) both;
}
@-webkit-keyframes dy{
0% {
width: 0;
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes dy{
0% {
width: 0;
}
100% {
opacity: 1;
}
}
p span {
width: 580px;
white-space: nowrap;
overflow: hidden;
display: block;
height: 26px;
line-height: 26px;
margin-bottom: 8px;
}