效果展示:
源码展示:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>纯CSS3实现文字的渐变动画</title>
<style>
.dv {
width:1000px;
height:300px;
margin:0 auto;
margin-top:100px;
font-size:80px;
text-align:center;
background:-webkit-linear-gradient(left,#147B96,#E6D205 25%,#147B96 50%,#E6D205 75%,#147B96);
color:transparent;
-webkit-background-clip:text;
background-size:200% 100%;
animation:masked-animation 1s infinite linear;
}
@-webkit-keyframes masked-animation {
0% {
background-position:0 0;
}
100% {
background-position:-100% 0;
}
}</style>
</head>
<body>
<div class="dv">嗨!我是C3文字渐变的效果</div>
</body>
</html>