动态的爱心代码 html
时间: 2023-03-01 11:10:21 浏览: 110
这是一份简单的动态爱心代码:
```html
<html>
<head>
<style>
.heart {
height: 50px;
width: 50px;
position: relative;
animation: beat 1s ease-in-out infinite;
}
.heart:before,
.heart:after {
content: "";
position: absolute;
left: 25px;
top: 0;
width: 25px;
height: 40px;
background: red;
border-radius: 25px 25px 0 0;
transform: rotate(45deg);
transform-origin: 0 100%;
}
.heart:after {
left: 0;
transform: rotate(-45deg);
transform-origin: 100% 100%;
}
@keyframes beat {
0% {
transform: scale(1);
}
20% {
transform: scale(1.1);
}
40% {
transform: scale(1);
}
}
</style>
</head>
<body>
<div class="heart"></div>
</body>
</html>
```
阅读全文