作者:123123 | 来源:互联网 | 2023-05-17 04:49
```
原理:一个正方形 两个圆 定位 旋转 圆角边属性
body部分
css部分
.heart-body{
width: 200px;
height: 200px;
left: 50%;
top: 50%;
margin: 10px auto;
background: red;
position: absolute;
transform: rotate(45deg);
animation: love 1s ease infinite;
}
.heart-shape{
width: 200px;
height: 200px;
background: indianred;
box-shadow: 0 0 50px rgb(255,0,0);
}
.heart-body:before{
content:'';
width: 200px;
height: 200px;
background: indianred;
border-radius: 50%;
box-shadow: 0 0 50px rgb(255,0,0);
position: absolute;
top: 0;
left: -100px;
}
.heart-body:after{
content:'';
width: 200px;
height: 200px;
background: indianred;
border-radius: 50%;
box-shadow: 0 0 50px rgb(255,0,0);
position: absolute;
top: -100px;
left: 0px;
}
@keyframes love {
0%,100%{transform: scale(0.9,0.9)rotate(45deg)}
50%{transform: scale(1.2,1.2)rotate(45deg)}
}
```