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>
相关推荐
Bl_a_ck23 分钟前
【React】Craco 简介
开发语言·前端·react.js·typescript·前端框架
为美好的生活献上中指1 小时前
java每日精进 5.11【WebSocket】
java·javascript·css·网络·sql·websocket·网络协议
augenstern4161 小时前
webpack重构优化
前端·webpack·重构
海拥✘1 小时前
CodeBuddy终极测评:中国版Cursor的开发革命(含安装指南+HTML游戏实战)
前端·游戏·html
寧笙(Lycode)2 小时前
React系列——HOC高阶组件的封装与使用
前端·react.js·前端框架
asqq82 小时前
CSS 中的 ::before 和 ::after 伪元素
前端·css
拖孩2 小时前
【Nova UI】十五、打造组件库之滚动条组件(上):滚动条组件的起步与进阶
前端·javascript·css·vue.js·ui组件库
Hejjon3 小时前
Vue2 elementUI 二次封装命令式表单弹框组件
前端·vue.js
小堃学编程3 小时前
前端学习(3)—— CSS实现热搜榜
前端·学习
Wannaer3 小时前
从 Vue3 回望 Vue2:响应式的内核革命
前端·javascript·vue.js