【案例】CSS3animation动画效果--太极图

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>animation动画效果--太极图</title>
		<style type="text/css">
			.box{
				width: 500px;
				height: 500px;
				border-radius: 50%;
				border: 1px solid black;
				overflow: hidden;
				position: absolute;
				
				animation: change 1s linear infinite;
			}
			.left,.right{
				width: 50%;
				height: 100%;
				float: left;
			}
			.left{
				background-color: #000000;
			}
			.right{
				background-color: #FFFFFF;
			}
			
			.top,.bottom{
				width: 250px;
				height: 250px;
				border-radius: 50%;
				position: absolute;
				left: 125px;
			}
			.top{
				background-color: #000000;
			}
			.bottom{
				background-color: #FFFFFF;
				top: 250px;
			}
			
			.cricle1,.cricle2{
				width: 50px;
				height: 50px;
				border-radius: 50%;
				position:absolute;
				top: 100px;
    			left: 102px;
			}
			.cricle1{
				background-color: #FFFFFF;
			}
			.cricle2{
				background-color: #000000;
			}
			
			//定义动画
			@keyframes change{
				from{
					transform: rotate(0deg);
				}
				to{
					transform: rotate(360deg);
				}
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="left">
				<div class="top">
					<div class="cricle1"></div>
				</div>
			</div>
			<div class="right">
				<div class="bottom">
					<div class="cricle2"></div>
				</div>
			</div>
		</div>
	</body>
</html>

运行效果如下:

在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值