用html写一个爱心页面
时间: 2023-10-03 11:07:41 浏览: 19
<!DOCTYPE html>
<html>
<head>
<title>My Love Page</title>
<meta charset="utf-8">
<style>
body {
background-color: #f3e5f5;
font-family: Arial, sans-serif;
text-align: center;
}
h1 {
color: #880e4f;
margin-top: 50px;
}
.heart {
position: relative;
margin-top: 50px;
width: 100px;
height: 90px;
transform: rotate(45deg);
background-color: #e91e63;
border-radius: 50px 0 50px 0;
animation: beat 1s infinite;
}
.heart:before,
.heart:after {
content: "";
position: absolute;
background-color: #e91e63;
border-radius: 50px 50px 0 0;
}
.heart:before {
top: -45px;
left: 0;
width: 100px;
height: 90px;
}
.heart:after {
top: 0;
left: 45px;
width: 100px;
height: 90px;
}
@keyframes beat {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}
p {
color: #880e4f;
font-size: 20px;
margin-top: 50px;
}
</style>
</head>
<body>
<h1>My Love Page</h1>
<div class="heart"></div>
<p>I love you more than words can say!</p>
</body>
</html>