流光按钮

复制代码
<!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, user-scalable=no">
    <title>流光按钮</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }

        body {
            background-color: black;
        }

        .btn {
            border: none;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 400px;
            height: 100px;
            font-size: 24px;
            background: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);
            background-size: 400%;
            color: white;
            border-radius: 50px;
            text-transform: uppercase;
            z-index: 1;
        }
        .btn::before {
            content: '';
            position: absolute;
            top: -5px;
            right: -5px;
            bottom: -5px;
            left: -5px;
            border: 1px solid red;
            background: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);
            background-size: 400%;
            border-radius: 50px;
            filter: blur(20px);
            z-index: -1;
        }

        .btn:hover {
            animation: sun 12s infinite;
        }
        .btn:hover::before {
            animation: sun 12s infinite;
        }

        @keyframes sun {
            100% {
                background-position: -400% 0;
            }
        }

    </style>
</head>
<body>

   <button class="btn">sunButton</button>

</body>
</html>
复制代码

 

posted @   蜘蛛流  阅读(19)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示