万物负阴而抱阳,冲气以为和
五个Div
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>太极图</title>
<style>
body{
background-color: #ccc;
}
/* 左半白又半黑 */
.box1{
width: 400px;
height: 400px;
border-radius: 50%;
background-color: #fff;
margin: 100px auto;
background-image: linear-gradient(to right, #fff 50%,#000 50%);
}
/* 中黑圆 */
.box2{
width: 200px;
height: 200px;
background-color: #000;
margin: 0 auto ;
border-radius: 50%;
box-sizing: border-box;
padding: 75px;
}
/* 中白圆 */
.box3{
width: 200px;
height: 200px;
background-color: #fff;
box-sizing: border-box;
margin: 0 auto ;
border-radius: 50%;
padding: 75px;
}
/* 小白圆 */
.box4{
width: 50px;
height: 50px;
background-color:#fff;
margin: 0 auto ;
border-radius: 50%;
}
/* 小黑圆 */
.box5{
width: 50px;
height: 50px;
background-color: #000;
margin:0 auto;
border-radius: 50%;
}
</style>
</head>
<body>
<div class="box1">
<div class="box2">
<div class="box4"></div>
</div>
<div class="box3">
<div class="box5"></div>
</div>
</div>
</body>
</html>
3个Div
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>太极图</title>
<style>
body{
background-color:#ccc;
}
.box1{
width: 400px;
height: 400px;
background: linear-gradient(to right,#fff 50%,#000 50%) no-repeat;
border-radius: 50%;
margin: 100px auto;
}
.box2{
width: 50px;
height: 50px;
background-color: #fff;
border-radius: 50%;
border: 75px solid black;
margin: 0 auto;
}
.box3{
width: 50px;
height: 50px;
background-color: black;
border-radius: 50%;
border: 75px solid #fff;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="box1">
<div class="box2"></div>
<div class="box3"></div>
</div>
</body>
</html>
一个Div
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>太极图</title>
<style>
body{
background-color: #ccc;
}
div{
width: 400px;
height: 400px;
margin: 100px auto;
border-radius: 50%;
background:
radial-gradient(#fff 25px,#000 25px,#000 70%,transparent 71%) 100px 0/200px 200px no-repeat,
radial-gradient(#000 25px,#fff 25px,#fff 70%,transparent 71%) 100px 200px/200px 200px no-repeat,
linear-gradient(to right,#fff 50%,#000 50%) no-repeat;
}
</style>
</head>
<body>
<div></div>
</body>
</html>