【发布时间】:2023-04-04 11:12:01
【问题描述】:
我一直在尝试解决这个问题,但到目前为止没有成功:我想使用 CSS 运行打字动画。动画必须在 7 秒后开始。我不知道该怎么做。我的代码如下所示:
HTML
<div class='background-fullwidth'>
<div class="css-typing">
This text will pop up using an typewriting effect
</div>
</div>
CSS
.css-typing {
width: 360px;
white-space: nowrap;
overflow: hidden;
-webkit-animation: type 3s steps(50, end);
animation: type 3s steps(55, end);
-o-animation: type 5s steps(50, end);
-moz-animation: type 3s steps(55, end);
padding: 10px;
}
.background-fullwidth {
width: 400px;
background-color: rgba(0, 50, 92, 0.7);
}
@keyframes type {
from { width: 0; }
to { width: 360px; }
}
@-moz-keyframes type {
from { width: 0; }
to { width: 360px; }
}
@-webkit-keyframes type {
from { width: 0; }
to { width: 360px; }
}
有谁知道如何添加这个计时器 - 假设动画必须在 7 秒后开始?从第二个 1 到 7 只需要显示包装 DIV(蓝色背景)。
Fiddle 看起来像这样: CSS Animation
【问题讨论】:
标签: html css animation css-animations