web旋转动画

<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8" />
<style type="text/css">
	body{
		text-align: center;
	}
	div{
		display: inline-block;
	}
.box{
	display: inline-block;
	width: 1000px;
	height: 500px;
	position: relative;
	text-align: center;
}
.child{
	top: 100px;
	text-align: center;
	width: 440px;
	height: 440px;
	position: relative;
	-webkit-animation: myrotate 86400s infinite;
}
/*太阳*/
.child > div:nth-child(1){
	transform: translate(-50%,-50%);
	position: absolute;
	top: 50%;
	border-radius: 50%;
	width: 80px;
	height: 80px;
	background: red;
}
/*地球和月亮的div*/
.child > div:nth-child(2){
	z-index: 1;
	top: 120px;
	left: 50px;
	width: 60px;
	height: 60px;
	position: absolute;
	text-align: center;
	animation: childrotate 86400s infinite;
}
/*地球*/
.child > div > div:nth-child(1){
	width: 20px;
	height: 20px;
	background: green;
	border-radius: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%,-50%);
}
/*月亮,最小的*/
.child > div >div:nth-child(2){
	border-radius: 50%;
	width: 10px;
	height: 10px;
	background: dimgray;
	position: absolute;
}
.child > div:nth-child(3){
	transform: translate(-50%,-50%);
	position: absolute;
	top: 50%;
	border-radius: 50%;
	width: 310px;
	height: 310px;
	border: 1px solid gray;
	background: transparent;
}
@keyframes myrotate{
	/*在规定的时间内,完成4000000度的旋转*/
	0%{
	-webkit-transform: rotate(0deg);	
	}
	100%{
	-webkit-transform: rotate(4000000deg);	
	}
}
@keyframes childrotate{
	/*在规定的时间内,完成50000000度的旋转*/
	0%{
	-webkit-transform: rotate(0deg);	
	}
	100%{
	-webkit-transform: rotate(50000000deg);	
	}
}
</style>
</head>
<body>
<div class="box">
	<div class="child">
		<div></div>
		<div>
			<div></div>
			<div></div>
		</div>
		<div></div>
	<div></div>
	</div>
</div>
</body>
</html>

效果gif图:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值