# 八卦阵![在这里插入图片描述]()
# 思路
主要通过css里的content属性
前::after
后::before
1
| <div class="taiji"></div>
|
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
| body {background-color: #ccc;}
.taiji { width: 150px; height: 300px; margin: 100px auto; border-right: 150px solid #000; background-color: #fff; border-radius: 150px; animation: box 2s infinite linear; }
.taiji::before, .taiji::after { content: ''; margin-left: 50%; display: block; width: 50px; height: 50px; background-color: #fff; border: 50px solid #000; border-radius: 75px; }
.taiji::after { background-color: #000; border: 50px solid #fff; }
@keyframes box{ from {}
to { transform: rotate(-360deg); } }
|