CSS3伪元素实现自动打字动画原理及代码

2018-12-2615:46:22网页设计Comments2,905 views字数 501阅读模式

原理:Typing Animation with Pseudo-Elements 看起来是打字,其实是使用伪元素覆盖在字符串上,然后逐渐减少伪元素覆盖宽度来实现的视觉效果。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sheji/9080.html

<div>
    <h1>Typing Animation</h1>
    <p class="tagline">
        <span class="tagline-skill"><span class="tagline-skill_inner">webdesign</span></span>
    </p>
</div>
复制代码
.tagline-skill_inner:after {
    content: "";
    position: absolute;
    top: -1px;
    right: 0;
    bottom: -2px;
    left: 0;
    border-left: 1px solid #fff;
    background-color: #2a2a28;
    -webkit-animation: animatetoright 1s steps(10) infinite alternate;
    animation: animatetoright 1s steps(10) infinite alternate;
}
复制代码

效果:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sheji/9080.html

CSS3伪元素实现自动打字动画原理及代码文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sheji/9080.html

作者:codercao文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sheji/9080.html

文章源自菜鸟学院-https://www.cainiaoxueyuan.com/sheji/9080.html
  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/sheji/9080.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定