前端录网站,记录前端点点滴滴,帮助程序猿快速成长!

text-fill-color + animation文字渐变光波流动动画实例页面

css3
CSS代码:
@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) { 
    .masked{
        background-image: -webkit-linear-gradient(left, #147B96, #E6D205 25%, #147B96 50%, #E6D205 75%, #147B96);
        -webkit-text-fill-color: transparent;
        -webkit-background-clip: text;
        -webkit-background-size: 200% 100%;
        -webkit-animation: masked-animation 4s infinite linear;
    }
}
@-webkit-keyframes masked-animation {
    0%  { background-position: 0 0;}
    100% { background-position: -100% 0;}
}
HTML代码:
<div class="masked">
    <h4>这是一段可选文字</h4>
</div>


转载请注明:前端录»text-fill-color + animation文字渐变光波流动动画实例页面