css3文字颜色渐变动画

2021-04-10 00:28

阅读:598

标签:html   nim   key   round   charset   bsp   cal   user   文字   

DOCTYPE html>html lang="zh-cn">head>
    meta charset="utf-8">
    meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    title>WECHAT_EMPTY_TITLEtitle>
    style>
@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;}
}
style>
body>
div class="masked">
    h4>这是一段可选文字h4>
div>
body>html>

 

css3文字颜色渐变动画

标签:html   nim   key   round   charset   bsp   cal   user   文字   

原文地址:https://www.cnblogs.com/weilianguang/p/12436792.html


评论


亲,登录后才可以留言!