太极的两种画法

1.利用两个全等的矩形拼成一个正方形,再将其变成两个半圆,凑在一起就是一个正圆

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			body{
				background-color: gray;
			}
			.outer1 {
				width: 600px;
				height: 300px;
				background-color: white;
				margin: 0px auto 0px auto;
				border-radius: 300px 300px 0 0;
				
			}

			.outer2 {
				width: 600px;
				height: 300px;
				background-color: black;
				margin: 0 auto;
				border-radius: 0 0 300px 300px;
			}

			.outer1:before {
				content: "";
				width: 300px;
				height: 300px;
				background-color: white;
				display: inline-block;
				transform: translate(0, 50%);
				border-radius: 50%;
			}

			.outer1:after {
				content: "";
				width: 150px;
				height: 150px;
				background-color: black;
				position: absolute;
				display: block;
				transform: translate(50%, -50%);
				border-radius: 50%;
			}

			.outer2:before {
				content: "";
				width: 300px;
				height: 300px;
				background-color: black;
				display: inline-block;
				position: absolute;
				transform: translate(100%, -50%);
				border-radius: 50%;
			}

			.outer2:after {
				content: "";
				width: 150px;
				height: 150px;
				background-color: white;
				position: absolute;
				display: block;
				transform: translate(250%, -50%);
				border-radius: 50%;


			}
			.box{
				margin: 500px auto 0px auto;
				width: 600px;
				height: 600px;
				border:1px solid black;
				border-radius: 50%;
				animation:xuanzhuan 4s infinite linear ;
			}
			
			@keyframes xuanzhuan{
					
				0%{
					transform: rotate(0deg);
				}
					
				25%{
					transform: rotate(-90deg);
				}
					
				50%{
					transform: rotate(-180deg);
				}
					
				75%{
					transform: rotate(-270deg);
				}
					
				100%{
					transform: rotate(-360deg);
				}
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="outer1">
			
			</div>
			<div class="outer2">
			
			</div>
		</div>
		
	</body>
</html>

2.利用border-left 和 border-right

条件
宽度为0高度为数值

【也可以利用border-top 与 border-bottom 此时高度为0】

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			body{
				background-color: gray;
			}
			.box{
				position: relative;
				margin: 300px auto;
				width: 0px;
				height: 600px;
				/* border-style: solid; */
				border-left: 300px   solid black;
				border-right: 300px  solid white;
				border-radius: 50%;
			}
			.box:before {
				content: "";
				width: 300px;
				height: 300px;
				display: block;
				background-color: white;
				transform: translate(-50%,0);
				border-radius: 50%;
			}
			
			.box:after {
				content: "";
				width: 100px;
				height: 100px;
				background-color: white;
				position: absolute;
				display: inline-block;
				transform: translate(-50%, 100%);
				border-radius: 50%;
			}
			.point{
				position: absolute;
				top:0;
			}
			.point:before{
				content: "";
				width: 300px;
				height: 300px;
				display: block;
				background-color: black;
				transform: translate(-50%,100%);
				border-radius: 50%;
			}
			.point:after{
					content: "";
				width: 100px;
				height: 100px;
				background-color: black;
				display: inline-block;
				transform: translate(-50%, -200%);
				border-radius: 50%;
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="point"></div>
		</div>
		
	</body>
</html>

在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值