【发布时间】:2019-04-03 11:29:12
【问题描述】:
当我在第二个文本上添加动画延迟时,第一个文本不会移动。而且我没有成功地进行文本滚动的无限循环。动画结束时总会有一些断点。
我尝试了几个在网上找到的代码,但没有一个完全符合我的要求。
.scroll span {
font-size: 1.5em;
animation: scroll 20s linear infinite;
position: absolute;
top: 92vh;
white-space: nowrap;
overflow: hidden;
}
.second span {
animation-delay: 10s;
}
@keyframes scroll {
0% {
transform: translate(-100%, 0);
}
100% {
transform: translate(100%, 0);
}
}
<div>
<p class="scroll first"><span>scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down </span></p>
<p class="scroll second"><span>scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down scroll down </span></p>
</div>
我只想要一个无限滚动的文本。
【问题讨论】: