html流光按钮

出处bilibili猫咪爱狗

html 复制代码
<!DOCTYPE html>
<html>
    <head>
        <style>
            body {/*内容居中,背景色*/
                height: 100vh;
                display: flex;
                justify-content: center;           
                align-items: center;
                background-color: #000;
            }
            a { /*水平垂直居中*/
                position: relative;
                display: inline-block;
                width: 200px;
                height: 60px;
                background-color: skyblue;
                color: #fff;
                line-height: 60px;
                text-align: center;
                /*渐变背景*/
                text-decoration: none;
                background: linear-gradient(90deg,
                    #03a9f4,
                    #f441a5,
                    #ffeb3b,
                    #03a9f4
                );
                /*圆角*/
                background-size: 400%;
                border-radius: 10px;
            }
            /*渐变动画*/
            @keyframes animate {
                0% {
                    background-position: 0 0;
                }
                100% {
                    background-position: 400% 0;
                }
            }
            /*鼠标悬停展示*/
            a:hover {
                animation: animate 8s linear infinite;
            }
            a:hover:before {
                filter: blur(20px);
                opacity: 1;
            }
            /*光影盒子*/
            a:before {
                content: '';
                position: absolute;
                left: -5px;
                top: -5px;
                right: -5px;
                bottom: -5px;
                z-index: -1;
                background: linear-gradient(90deg,
                #03a9f4,
                #f441a5,
                #ffeb3b,
                #03a9f4);
                background-size: 400%;
                border-radius: 10px;
                opacity: 0;
                transition: all 1s;
            }
        </style>
    </head>
    <body>
        <a href="#">Button</a>
    </body>
</html>
相关推荐
菲利普马洛4 小时前
记一次主题闪烁问题
前端·css·react.js
逆光如雪6 小时前
移动端卡片边框怎么做高级?我用 CSS 实现了设计师的刁钻要求
前端·css·vue.js
天下无贼!8 小时前
【功能实现】基于Vue3+TS实现大文件分片上传
开发语言·javascript·node.js·vue·html5
前端老石人10 小时前
HTML 入门指南:从规范视角建立正确知识体系
开发语言·前端·html
mit6.82411 小时前
GeekDoc
html
precious。。。1 天前
1.2.1 三角不等式演示
前端·javascript·html
星空1 天前
前段--A_2--HTML属性标签
前端·html
a1117761 天前
MapDesigner (html开源项目)六角格地图设计工具
开源·html
夜雨飘零11 天前
零门槛!用 AI 生成 HTML 并一键部署到云端桌面
人工智能·python·html
PieroPc1 天前
一个为 AI 助手设计的进销存管理系统,内置完整的 CLI 命令接口,让 AI 可以通过自然语言或命令行直接操作库存。技术栈 FastAPI+Html
人工智能·html·fastapi·cli