html代码

<div class=“wrap”>肆零肆萌化博客</div>

css样式表

@keyframes move {

0% {backgroundposition: 0 0;}

100% {

/*宽度固定,如果为百分比背景不会滚动*/

backgroundposition: 300px 0;

}

}

.wrap {

/*设置背景渐变色*/

backgroundimage: lineargradient(to right, red, orange, yellow, green, yellow, orange, red, orange, yellow, green, yellow, orange, red);

/*chrome 私有样式,加前缀,显示背景图片*/

webkitbackgroundclip: text;

animation: move 5s infinite;

/*颜色设为透明*/

color: transparent;

/*宽度固定*/

width: 300px;

}

效果图