用HTML和CSS写个爱心网页
时间: 2024-05-24 09:11:36 浏览: 6
<!DOCTYPE html>
<html>
<head>
<title>爱心网页</title>
<style>
body {
background-color: pink;
}
.heart {
position: relative;
width: 100px;
height: 90px;
transform: rotate(-45deg);
background-color: #f00;
}
.heart:before,
.heart:after {
position: absolute;
content: "";
left: 50px;
top: 0;
width: 50px;
height: 80px;
background-color: #f00;
border-radius: 50px 50px 0 0;
}
.heart:before {
transform: rotate(-45deg);
}
.heart:after {
transform: rotate(45deg);
}
.text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 30px;
color: #fff;
font-family: Arial, sans-serif;
text-shadow: 2px 2px #000;
}
</style>
</head>
<body>
<div class="heart"></div>
<div class="text">我爱你</div>
</body>
</html>