用html写一个爱心页面
时间: 2023-05-17 07:03:45 浏览: 33
非常感谢您的提问,以下是用HTML写一个爱心页面的代码:
<!DOCTYPE html>
<html>
<head>
<title>爱心页面</title>
<meta charset="UTF-8">
<style>
body {
background-color: #f8f8f8;
font-family: Arial, sans-serif;
}
.heart {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100px;
height: 90px;
background-color: #ff6b6b;
border-radius: 50px 50px 0 0;
transform-origin: 50% 100%;
animation: heartbeat 1s ease-in-out infinite;
}
.heart:before,
.heart:after {
content: "";
position: absolute;
background-color: #ff6b6b;
border-radius: 50px 50px 0 0;
}
.heart:before {
width: 100px;
height: 100px;
top: -50px;
left: 0;
}
.heart:after {
width: 100px;
height: 100px;
top: 0;
left: 50px;
}
@keyframes heartbeat {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
</style>
</head>
<body>
<div class="heart"></div>
</body>
</html>
希望这个代码能够满足您的需求,如果您有任何问题或需要进一步的帮助,请随时联系我。