其他分享
首页 > 其他分享> > CSS实现字体特效

CSS实现字体特效

作者:互联网

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
    body {text-align: center; font-size: 30px;}
        #colorFont {
            background-image: linear-gradient(to right, red, orange, yellow, green, blue, yellow, orange, red, orange, yellow, green, yellow, orange, red);
            -webkit-text-fill-color: transparent;
            -webkit-background-clip: text;
            -webkit-background-size: 200% 100%;
            -webkit-animation: colorFont-animation 800ms infinite linear;
        }
        @-webkit-keyframes colorFont-animation {
            0%{ background-position: 0 0;}
            100% { background-position: -100% 0;}
        }
    </style>
</head>
<body>
<span id="colorFont">欢迎大家留言交流技术,记得关注我哦!</span>
</body>
</html>

 

标签:特效,text,yellow,orange,animation,字体,background,webkit,CSS
来源: https://www.cnblogs.com/ninama/p/16126545.html