zoukankan      html  css  js  c++  java
  • CSS实现文字聚光灯效果

    实现代码

    body{
        background:#222;
        display:flex;
        justify-content:center;
        align-items:center;
        min-height:100vh;
    }
    h1{
        color:#333;
        font-size:8rem;
    }
    h1:after{
        content:"SPOTLIGHT";
        color:transparent;
        position:absolute;
        left:0;
        top:0;
        background-image: linear-gradient(to right, red,orange,yellow,green,blue,indigo,violet);
        background-clip:text;
        -webkit-background-clip: text;
        clip-path:circle(100px at 0% 50%);
        -webkit:circle(100px at 0% 50%);
        animation:light 5s infinite;
    }
    
    @keyframes light{
        0%{
            clip-path:circle(100px at 0% 50%);
            -webkit:circle(100px at 0% 50%);
        }
        50%{
            clip-path:circle(100px at 100% 50%);
            -webkit:circle(100px at 100% 50%);
        }
        100%{
            clip-path:circle(100px at 0% 50%);
            -webkit:circle(100px at 0% 50%);
        }
    }
    
  • 相关阅读:
    think in java
    TASLock TTASLock
    多线程
    jenkins unable to delete file
    ubuntu sun-jdk
    py2exe
    memcached安装
    redis安装
    ubuntu安装ssh
    mysql远程访问
  • 原文地址:https://www.cnblogs.com/muphalem/p/13619088.html
Copyright © 2011-2022 走看看