<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="texthtml; charset=utf-8" />
<title>CSDN</title>
<style type="text/css">
@keyframes move {
0% {background-position: 0 0;}
100% {
/*宽度固定,如果为百分比背景不会滚动*/
background-position: -300px 0;
}}
.wrap {/*设置背景渐变色*/
background-image: linear-gradient(to right, red, orange, yellow, green, yellow, orange, red, orange, yellow, green, yellow, orange, red);
/*chrome私有样式,加前缀,文字显示背景图片*/
-webkit-background-clip: text;
animation: move 5s infinite;
/*文字颜色设为透明*/
color: transparent;
/*宽度固定*/
width: 310px;}
</style>
</head>
<body>
<center><div class="wrap">CSDN</div></center>
</body>
<html>
字体逐渐变颜色
最新推荐文章于 2024-09-08 22:57:57 发布