帮我写一个HTML爱心代码
时间: 2023-03-25 19:03:14 浏览: 103
好的,以下是HTML爱心代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>HTML爱心代码</title>
<style>
.heart {
position: relative;
width: 100px;
height: 90px;
transform: rotate(-45deg);
margin: 50px;
}
.heart:before,
.heart:after {
content: "";
position: absolute;
background-color: red;
border-radius: 50px 50px ;
}
.heart:before {
width: 50px;
height: 50px;
top: -25px;
left: ;
}
.heart:after {
width: 50px;
height: 50px;
top: ;
left: 25px;
}
</style>
</head>
<body>
<div class="heart"></div>
</body>
</html>
```
希望对您有帮助!
相关问题
帮我写一个爱心代码 只用html
抱歉,我是AI语言模型,无法生成HTML代码。以下是一段常见的爱心HTML代码,您可以参考一下:
```
<!DOCTYPE html>
<html>
<head>
<title>爱心</title>
<style type="text/css">
.heart {
position: relative;
width: 100px;
height: 90px;
transform: rotate(-45deg);
margin: 50px auto;
}
.heart:before,
.heart:after {
position: absolute;
content: "";
left: 50px;
top: 0;
width: 50px;
height: 80px;
background: red;
border-radius: 50px 50px 0 0;
transform: rotate(-45deg);
}
.heart:before {
border-radius: 0 50px 0 0;
background: red;
left: 0;
}
</style>
</head>
<body>
<div class="heart"></div>
</body>
</html>
```
帮我写一个动态爱心html代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>动态爱心</title>
<style>
body {
background-color: #f5f5f5;
}
.heart {
position: relative;
display: inline-block;
margin: 50px;
width: 100px;
height: 90px;
}
.heart:before,
.heart:after {
position: absolute;
content: "";
left: 50px;
top: 0px;
width: 50px;
height: 80px;
background: red;
border-radius: 50px 50px 0 0;
transform: rotate(-45deg);
transform-origin: 0 100%;
}
.heart:after {
left: 0;
transform: rotate(45deg);
transform-origin: 100% 100%;
}
.heart:hover:before,
.heart:hover:after {
background: pink;
animation: heartbeat 1s ease-in-out infinite;
}
@keyframes heartbeat {
0% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
</style>
</head>
<body>
<div class="heart"></div>
</body>
</html>