css3之animation 提交按钮简单的动画

复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        body{
            width: 100vw;
            height: 100vh;
            display: grid;
            grid-template: 1fr/1fr;
        }
        .btn{
            width: 200px;
            height: 50px;
            text-align: center;
            line-height: 50px;
            color:green;
            justify-self: center;
            align-self: center;
        }
        .btn::after{
            content: '';
            width: 3px;
            height: 3px;
            display: inline-block;
            animation-name: yd;
            animation-duration: 1s;
            animation-iteration-count: infinite;
        }
        @keyframes yd {
            from{
                box-shadow: none;
            }
            30%{
                box-shadow: 3px 0 0 currentColor;
            }
            60%{
                box-shadow: 3px 0 0 currentColor,9px 0 0 currentColor;
            }
            90%{
                box-shadow: 3px 0 0 currentColor,9px 0 0 currentColor,15px 0 0 currentColor;
            }
            to{
                box-shadow: 3px 0 0 currentColor,9px 0 0 currentColor,15px 0 0 currentColor;
            }
        }
    </style>
</head>
<body>
    <button class="btn">提交</button>
</body>
</html>
相关推荐
+VX:Fegn08953 小时前
计算机毕业设计|基于springboot + vue蛋糕店管理系统(源码+数据库+文档)
前端·数据库·vue.js·spring boot·课程设计
Nicander4 小时前
我给 Excalidraw 做了一个本地工作区:DrawSpace
前端·开源
linux_cfan6 小时前
17 · 引擎适配器全景:HLS/DASH/Vimeo/Mux/Cast
前端·javascript·音视频
计算机魔术师6 小时前
烧掉2780亿美元还不够?OpenAI的资本豪赌让人头皮发麻
前端
IT_陈寒7 小时前
Java线程池用错参数,我的服务居然悄悄崩溃了
前端·人工智能·后端
卡布鲁7 小时前
React useMemo 与 useCallback 完全指南:原理、场景与避坑
前端·react.js
碳基修炼8 小时前
排查记:本地 devServer 是 http,浏览器却把 302 重定向升级成了 https
前端·http
步行cgn8 小时前
Spring p 命名空间注入详解
java·前端·spring
何何____8 小时前
Vue 生命周期详解
前端·javascript
江米小枣tonylua8 小时前
TypeScript 全面の拥抱 !Prisma 8 + Electron 升级实战
前端