CSS绘制太极图
效果如下:

代码如下:
<template>
<div class="box">
<div class="white">
<div class="white-black">
<div class="white-dot"></div>
</div>
</div>
<div class="black">
<div class="black-white">
<div class="black-dot"></div>
</div>
</div>
</div>
</template>
<style scoped>
.box {
width: 200px;
height: 200px;
border: 1px solid #0000EE;
border-radius: 100%;
overflow: hidden;
}
.white {
position: relative;
width: 200px;
height: 100px;
background-color: #FFFFFF;
}
.white-black {
position: absolute;
width: 100px;
height: 100px;
border-radius: 100%;
right: 0;
top: 50%;
background-color: black;
}
.white-dot {
position: absolute;
width: 25px;
height: 25px;
border-radius: 100%;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
background-color: #FFFFFF;
z-index: 100;
}
.black {
position: relative;
width: 200px;
height: 100px;
background-color: black;
}
.black-white {
position: absolute;
width: 100px;
height: 100px;
border-radius: 100%;
left: 0;
top: -50%;
background-color: #FFFFFF;
}
.black-dot {
position: absolute;
width: 25px;
height: 25px;
border-radius: 100%;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
background-color: black;
z-index: 100;
}
</style>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
上次更新: 2025/09/05, 8:09:00