[英]How can I make a writing animation(change of text) on a users hover with HTML, CSS, and JS, just without the caret
This works for one line.这适用于一行。 The only problem is that it doesn't wrap text.
唯一的问题是它不换行文本。
.typewriter { width: fit-content; } .typewriter div { overflow: hidden; white-space: nowrap; margin: 0 auto; letter-spacing: .05em; animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite; } @keyframes typing { from { width: 0 } to { width: 100% } }
<div class = 'typewriter'> <div> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.