(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>