【发布时间】:2020-01-11 16:10:15
【问题描述】:
我正在尝试创建一个连续的文本动画。一行,然后是下一行,然后是下一行。但它同时为所有三行设置动画。
.autotype {
overflow: hidden;
white-space: nowrap;
}
.autotype {
animation: autotype 8s steps(10, end);
animation-iteration-count: infinite;
}
@keyframes autotype {
from {
width: 0px;
}
}
@keyframes autotype {
0% {
width: 0px;
}
20% {
width: 70px;
}
40% {
width: 140px;
}
60% {
wdith: 210px;
}
80%. {
width: 280px;
}
100% {
width: 500px;
}
}
.alignnone {
height: 20px;
width: 50px;
position: relative;
top: 4px;
}
<div class="autotype">.
<p>Hello, and welcome to
<img src="http://4309.co.uk/wp-
content/uploads/2020/01/
Screenshot_20200110_150836-
300x115.jpg" alt="" width="300" height="115" class="alignnone size-medium
wp-image-8431" />Feel free to look</p>
<p>around the site and contact us via the form<br> on the contact page</div>
那么,我如何对其进行动画处理以使其显示第一行,并且只有在完全显示时才开始第二行,依此类推。我已经尝试在动画本身中使用高度,但是,虽然这适用于第一行,但当它在下一行变得更高时,它们已经渲染了。
【问题讨论】:
标签: html css css-animations