用记事本写一个显示爱心的网页
时间: 2023-09-28 22:12:04 浏览: 86
好的,以下是一个简单的HTML代码,可以在记事本中保存为.html文件,然后在浏览器中打开,就可以看到一个显示爱心的网页:
```html
<!DOCTYPE html>
<html>
<head>
<title>显示爱心的网页</title>
<meta charset="UTF-8">
<style>
body {
background-color: #f2f2f2;
}
.heart {
background-color: #ff69b4;
width: 50px;
height: 50px;
position: relative;
animation: heartbeat 1s ease infinite;
}
.heart:before,
.heart:after {
content: "";
background-color: #ff69b4;
border-radius: 25px 25px 0 0;
position: absolute;
}
.heart:before {
width: 50px;
height: 50px;
top: -25px;
left: 0;
}
.heart:after {
width: 50px;
height: 50px;
top: 0;
left: 25px;
}
@keyframes heartbeat {
0% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
</style>
</head>
<body>
<div class="heart"></div>
</body>
</html>
```
在浏览器中打开这个网页,你就会看到一个粉色的爱心在跳动。