<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>粉色爱心❤</title>
<style>
*{
background-color: skyblue;
}
.love{
background-color: pink;
width: 200px;
height: 200px;
box-shadow: 0px 0px 70px pink;
animation: 1s hb infinite; <!--调用动画 infinite循环动画-->
}
.y1{
border-radius: 100px;
position: absolute;
left: 703px;
top: 199px;
}
.y2{
border-radius: 100px;
position: absolute;
left: 541px;
top: 201px;
}
.f{
transform: rotate(45deg);<!--旋转45度-->
position: absolute;
left: 620px;
top: 280px;
}
@keyframes hb{
0%{transform: scale(1) rotate(45deg);}
50%{transform: scale(1.1) rotate(45deg);}
100%{transform: scale(1) rotate(45deg);}
}
</style>
</head>
<body>
<div class="love y1"></div>
<div class="love y2"></div>
<div class="love f"></div>
</body>
</html>
开发工具HBuilder X
效果: