-
Notifications
You must be signed in to change notification settings - Fork 0
/
h.css
69 lines (57 loc) · 1.15 KB
/
h.css
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
*{
margin: 0px;
padding: 0px;
}
body{
background-color: plum;
/* 弹性盒子模型将整个心放在中间 */
display: flex;
flex-direction: row;
align-items: center;
justify-content:center;
}
html, body{
/* 让容器的宽度、高度均撑满100% */
width: 100%;
height: 100%;
}
.heart{
width: 200px;
height: 200px;
background-color: red;
position: relative;
transform: rotate(45deg);
/* 加入动画内容 */
animation: heartbeat 0.5s alternate infinite;
box-shadow: 0px 0px 30px red;
}
.heart::before{
content: "";
width: 200px;
height: 100px;
background-color: red;
position: absolute;
left: 0;
top: -99px;
border-top-left-radius: 100px;
border-top-right-radius: 100px;
}
.heart::after{
content: "";
width: 100px;
height: 200px;
background-color: red;
position: absolute;
left: -99px;
border-top-left-radius: 100px;
border-bottom-left-radius: 100px;
}
/* 实现动画 */
@keyframes heartbeat{
0%{
transform: rotate(45deg) scale(0.6);
}
100%{
transform: rotate(45deg) scale(1.4);
}
}