动态渐变文字效果
( 更新:10-20 加入收藏)
效果展示:
具体代码如下:
css代码:
闲看儿童捉柳花
具体代码如下:
css代码:
html部分代码:@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: 300px;}
<div class="wrap"> 闲看儿童捉柳花</div>
上一篇:纯js实现文字自动变色效果
下一篇:简单防止恶意刷新攻击php代码