css3 画太极图——用一个div实现

(1)绘制两个半圆:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>css 绘制太极图</title>
    <style class="cp-pen-styles">
       *{
           padding:0;
           margin:0;
       }
       .outer{
           margin:100px auto;
           width:0;
           height:500px;
           border-radius: 500px;
           position:relative;
           border-left:250px solid black;
		   border-right:250px solid white;
		   box-shadow:0 0 30px #D3D3D3;
       }
    </style>
</head>
<body>
<div class="outer">
</div>
</body>
</html>

在这里插入图片描述
(2)绘制上面的圆:

	.outer:after{
           width:250px;
           height:250px;
           position:absolute;
		   left:-125px;
		   display:block;
		   content:"";
           z-index:1;
		   background-color:white;
		   border-radius:50%;
   }

在这里插入图片描述
(3)绘制下面的圆:

	.outer:after{
           width:250px;
           height:250px;
           position:absolute;
		   left:-125px;
		   display:block;
		   content:"";
           z-index:1;
		   background-color:white;
		   border-radius:50%;
		   box-shadow:0 250px 0 black;
   }

在这里插入图片描述
(4)绘制上面的小圆:

	.outer:before {
			content:"";
            position:absolute;
            display: block;
            width:100px;
            height:100px;
            top:75px;
            left:-50px;
            z-index:2;
            background-color:black;
            border-radius:50%;
	}

在这里插入图片描述
(5)绘制下面的小圆:

	.outer:before {
			content:"";
            position:absolute;
            display: block;
            width:100px;
            height:100px;
            top:75px;
            left:-50px;
            z-index:2;
            background-color:black;
            border-radius:50%;
			box-shadow:0 250px 0 white;
	}

在这里插入图片描述

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>css 绘制太极图</title>
    <style class="cp-pen-styles">
       *{
           padding:0;
           margin:0;
       }
       .outer{
           margin:100px auto;
           width:0;
           height:500px;
           border-radius: 500px;
           position:relative;
           border-left:250px solid black;
		   border-right:250px solid white;
		   box-shadow:0 0 30px #D3D3D3;
       }
	   .outer:after{
           width:250px;
           height:250px;
           position:absolute;
		   left:-125px;
		   display:block;
		   content:"";
           z-index:1;
		   background-color:white;
		   border-radius:50%;
		   box-shadow:0 250px 0 black;
       }
	   .outer:before {
			content:"";
            position:absolute;
            display: block;
            width:100px;
            height:100px;
            top:75px;
            left:-50px;
            z-index:2;
            background-color:black;
            border-radius:50%;
			box-shadow:0 250px 0 white;
	   }
    </style>
</head>
<body>
<div class="outer">
</div>
</body>
</html>
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值