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>
相关推荐
西陵3 分钟前
Nx带来极致的前端开发体验——任务编排
前端·javascript·架构
大前端helloworld10 分钟前
从初中级如何迈入中高级-其实技术只是“入门卷”
前端·面试
东风西巷2 小时前
Balabolka:免费高效的文字转语音软件
前端·人工智能·学习·语音识别·软件需求
萌萌哒草头将军2 小时前
10个 ES2025 新特性速览!🚀🚀🚀
前端·javascript·vue.js
半夏陌离2 小时前
SQL 入门指南:排序与分页查询(ORDER BY 多字段排序、LIMIT 分页实战)
java·前端·数据库
whysqwhw2 小时前
鸿蒙工程版本与设备版本不匹配
前端
gnip2 小时前
http缓存
前端·javascript
我不只是切图仔3 小时前
我只是想给网站加个注册验证码,咋就那么难!
前端·后端
该用户已不存在3 小时前
macOS是开发的终极进化版吗?
前端·后端