如何使用CSS和JavaScript显示带有“线性擦除”效果的文本。怎么做?
<p>Text linear wipe </p>
答案 0 :(得分:6)
检查此代码段:
p{
white-space: nowrap;
overflow: hidden;
width: 30em;
animation: linearwipe 6s steps(60, end);
}
@keyframes linearwipe{
from { width: 0; }
}
<p>Text linear wipe </p>
答案 1 :(得分:0)
此代码完美无缺:
CSS:
.linear-wipe{
white-space: nowrap;
overflow: hidden;
animation: linearwipe 1s steps(100, end);
opacity: 1;
width: 0%;
}
@keyframes linearwipe{
from { width: 0;opacity: 0 }
}