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>
相关推荐
智算菩萨2 小时前
使用免费托管平台搭建并部署静态与动态网页教程
服务器·html5·网页·网页部署
cyforkk3 小时前
Spring Boot 3 集成 Swagger 踩坑实录:解决 doc.html 404 与 Unauthorized 拦截
spring boot·后端·html
ZHOUPUYU3 小时前
PHP与WebSocket实时通信的原理到生产级应用
开发语言·html·php
uimaker3 小时前
uimaker响应式jQuery Easyui+Bootstrap多配色主题设计
前端框架·bootstrap·html·jquery·easyui·后台模版
Luna-player4 小时前
Vue 组件,用来实现一个响应式图标网格布局,核心是用 CSS 实现固定宽高比的正方形容器,并在里面放置图片和文字。
前端·css·vue.js
Predestination王瀞潞5 小时前
6.5.2 软件->W3C HTML5、CSS3标准(W3C Recommendation):HTML(HyperText Markup Language)
html·css3·html5
Greg_Zhong6 小时前
Css知识之伪类和伪元素
前端·css
#麻辣小龙虾#6 小时前
html浏览器自动播放视频策略
前端·html·音视频
这儿有一堆花7 小时前
从技术标准到营销概念:深度解析 HTML5 与 H5 的演变与区别
前端·html·html5
我命由我123457 小时前
React - 创建 React 项目、React 项目结构、React 简单案例、TodoList 案例
前端·javascript·react.js·前端框架·ecmascript·html5·js