动态彩虹渐变字效

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .gradient-text {
            color: transparent;
            background: -webkit-linear-gradient(30deg, #32c5ff 25%, #b620e0 50%, #f7b500 75%, #20e050 100%);
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-size: auto;
            display: inline-block;
            animation: gradientText 300s infinite linear;
        }

        @keyframes gradientText {
            0% {
                background-position: 0;
            }

            100% {
                background-position: 28000px;
            }
        }
    </style>
</head>

<body>
    <div class="gradient-text">
        455454
    </div>

</body>

</html>
posted @ 2022-12-30 11:55  7c89  阅读(27)  评论(0)    收藏  举报