小月亮-动画

六眼飞鱼酱① 提交于 2020-02-20 22:02:30
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>小太阳案例</title>
	<style type="text/css">
        /*小太阳*/
        * {
        	margin: 0;
        	padding: 0;
        }
        html,body {
        	width: 100%;
        	height: 100%;
        	overflow: hidden;
        }

        .sun {
        	width: 100px;
        	height: 100px;
        	margin:100px;
        	position: relative;
        }

        .sun::before,.sun::after {
        	content: "";
        	position: absolute;
        	top: 50%;
        	left: 50%;
        	width: 50px;
        	height: 50px;
        	transform: translate(-50%,-50%);
        	background-color: rgba(255,255,255,0.8);
        	border-radius: 50%;
        	animation: sun 2s infinite;
        }
        .sun::after {
        	width: 80px;
        	height: 80px;
        	background: rgba(255,255,255,0.6);
        	animation: sun 3s infinite;
        }


        @keyframes sun {
        	0% {
        		transform: translate(-50%,-50%) scale(1);
        		box-shadow: 0px 0px 5px rgba(255,255,255,0.7);
        	}
        	50% {
        		transform: translate(-50%,-50%) scale(1.1);
        		box-shadow: 0px 0px 30px rgba(255,255,255,0.7);
        	}
        	100% {
        		transform: translate(-50%,-50%) scale(1);
        		box-shadow: 0px 0px 5px rgba(255,255,255,0.7);
        	}
        }

	</style>
</head>
<body>
	<div class="sun"></div>
</body>
</html>

  

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!