<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>heart</title>
<style>
div {
position: relative;
width: 100px;
height: 100px;
margin: 250px auto;
background-color: red;
transform: rotate(45deg);
animation: heart 1s infinite;
}
div::before,
div::after {
content: "";
position: absolute;
background-color: red;
width: 100px;
height: 100px;
border-radius: 50%;
}
div::before {
top: -60px;
}
div::after {
left: -60px;
}
@keyframes heart {
0% {
transform: rotate(45deg) scale(0.5);
}
100% {
transform: rotate(45deg) scale(1);
}
}
</style>
</head>
<body style="background-color: antiquewhite">
<div></div>
</body>
</html>
html+css实现心跳效果
最新推荐文章于 2022-10-17 12:50:16 发布