css动画 提交按钮省略号加载动画

做法:
	给按钮的文字添加伪类,然后利用阴影是移动和原本元素大小相同的原理
	在动画中依次添加多个水平方向移动的阴影

代码示例:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	<link rel="stylesheet" href="./index.css">
	<style>
		.box{
			width: 400px;
			height: 400px;
			border: solid 1px blueviolet;
			display: flex;
			align-items: center;
			justify-content: center;
			margin: 100px auto;
			perspective: 900px;
		}
		.box>div{
			width: 200px;
			height: 200px;
			position: absolute;
			display: flex;
			justify-content: center;
			align-items: center;
			font-size: 4em;
			background-color: #8A2BE2;
		}
		.box>div::after{
			content: '';
			width: 4px;
			height: 4px;
			animation-name:hd;
			animation-duration: 1s;
			animation-iteration-count: infinite;
		}
		@keyframes hd{
			from{
				box-shadow:none;
			}
			30%{
				box-shadow: 4px 0 0 currentColor;
			}
			60%{
				box-shadow: 4px 0 0 currentColor,12px 0 0 currentColor;
			}
			90%{
				box-shadow: 4px 0 0 currentColor,12px 0 0 currentColor,20px 0 0 currentColor;
			}
		}

		

		
		 
	</style>
	</head>
	<body class='me'>
		<div class='box'>
			<div class='heart'>内容</div>
			<!-- <div>2</div> -->
	

		</div>
		
	</body>
</html>

效果图:
在这里插入图片描述在这里插入图片描述在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值