用html和css写出一个粉色的爱心
时间: 2024-01-24 18:20:35 浏览: 75
可以尝试以下代码:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>粉色爱心</title>
<style>
.heart {
width: 50px;
height: 50px;
position: relative;
margin: auto;
transform: rotate(45deg);
box-shadow: -1px -1px 0 1px #f2b1c2;
}
.heart:before,
.heart:after {
content: "";
position: absolute;
background-color: #f2b1c2;
}
.heart:before {
width: 50px;
height: 50px;
border-radius: 25px 25px 0 0;
top: -25px;
left: 0;
}
.heart:after {
width: 50px;
height: 50px;
border-radius: 0 0 25px 25px;
top: 0;
left: 25px;
}
</style>
</head>
<body>
<div class="heart"></div>
</body>
</html>
```
效果如下:
![pink-heart](https://i.imgur.com/8aWg5li.png)
阅读全文