分享张鑫旭大神的,纯css打字小技巧,我顺便收藏一下

CSS代码:
.typing {
     15em;
    white-space: nowrap;
    border-right: 2px solid transparent;
    animation: typing 3.5s steps(15, end), blink-caret .75s step-end infinite;
    overflow: hidden;
}
/* 打印效果 */
@keyframes typing {
  from {  0; }
  to {  15em; }
}
/* 光标闪啊闪 */
@keyframes blink-caret {
  from, to { box-shadow: 1px 0 0 0 transparent; }
  50% { box-shadow: 1px 0 0 0; }
}
HTML代码:
<p class="typing">简易中文打字效果,作者:张鑫旭</p>

原文链接:https://www.zhangxinxu.com/wordpress/2019/01/css-typewriter-effect/

原文地址:https://www.cnblogs.com/liliy-w/p/10255850.html