css实现字体特效,具体实例看本站的文章留言框上方。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> #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>