# css 八卦图
# 涉及知识点
css实现
<template>
<div class="box-infinity">
<div class="gossip"></div>
</div>
</template>
<style>
.box-infinity{
height:auto;
background: #092756;
display:flex;
justify-content: center;
align-items:center;
flex-direction: column;
min-height:200px;
}
.gossip {
width: 96px;
height: 48px;
background: #eee;
border-color: black;
border-style: solid;
border-width: 2px 2px 50px 2px;
border-radius: 100%;
position: relative;
animation: run 5s infinite;
box-sizing:content-box;
}
.gossip:before {
content: "";
position: absolute;
top: 50%;
left: 0;
background: #eee;
border: 18px solid black;
border-radius: 50%;
width: 12px;
height: 12px;
}
.gossip:after {
content: "";
position: absolute;
top: 50%;
left: 50%;
background: black;
border: 18px solid #eee;
border-radius:100%;
width: 12px;
height: 12px;
}
@keyframes run {
0%{}
50%{
transform: rotate(180deg);
}
100%{
transform: rotate(360deg);
}
}
</style>
<script>
export default {
data: () => ({ }),
mounted(){ },
methods:{ }
}
</script>
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
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