爱心页面 HTML 代码:简单易懂的示例
<!DOCTYPE html>
<html>
<head>
<title>爱心页面</title>
<style>
body {
background-color: #f9f9f9;
font-family: Arial, sans-serif;
text-align: center;
margin-top: 100px;
}
<pre><code>.heart {
width: 100px;
height: 100px;
background-color: red;
position: relative;
transform: rotate(45deg);
margin: 0 auto;
animation: heartbeat 1s infinite;
}
.heart:before,
.heart:after {
content: '';
width: 100px;
height: 100px;
background-color: red;
border-radius: 50%;
position: absolute;
}
.heart:before {
top: -50px;
left: 0;
}
.heart:after {
top: 0;
left: 50px;
}
@keyframes heartbeat {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
</code></pre>
</style>
</head>
<body>
<div class="heart"></div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/pDlY 著作权归作者所有。请勿转载和采集!