用html写网页爱心表白代码
时间: 2023-10-02 17:13:32 浏览: 98
可以。您可以使用以下代码:
```
<!DOCTYPE html>
<html>
<head>
<title>爱心表白</title>
<meta charset="UTF-8">
<style>
body{
background-color: #F8F8FF;
font-family: Arial, sans-serif;
text-align: center;
}
h1{
color: red;
font-size: 30px;
font-weight: bold;
margin: 50px 0 0;
}
.heart{
width: 100px;
height: 90px;
position: relative;
margin: 50px auto;
transform: translateY(45px) rotate(-45deg);
transform-origin: 50% 0;
}
.heart:before,
.heart:after{
content: "";
background-color: red;
border-radius: 50px 50px 0 0;
position: absolute;
}
.heart:before{
width: 100px;
height: 100px;
top: -50px;
left: 0;
}
.heart:after{
width: 100px;
height: 100px;
top: 0;
left: 50px;
}
.message{
font-size: 20px;
font-weight: bold;
color: red;
margin: 50px 0;
}
</style>
</head>
<body>
<h1>爱心表白</h1>
<div class="heart"></div>
<p class="message">我爱你</p>
</body>
</html>
```
当然,您可以根据自己的喜好对代码进行修改。
阅读全文