提供一个爱心圣诞树的网页代码
时间: 2023-02-07 22:41:03 浏览: 291
你好! 下面是一个爱心圣诞树的 HTML 代码:
```
<!DOCTYPE html>
<html>
<head>
<style>
.tree {
height: 300px;
width: 300px;
border: 1px solid #ccc;
margin: 0 auto;
position: relative;
}
.tree:before,
.tree:after {
content: '';
position: absolute;
left: 150px;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}
.tree:before {
bottom: 100%;
border-bottom: 100px solid #ccc;
}
.tree:after {
bottom: calc(100% - 50px);
border-bottom: 50px solid #ccc;
}
.tree > div {
position: absolute;
bottom: 0;
left: 150px;
width: 0;
height: 0;
border: 25px solid transparent;
border-bottom: 50px solid #e74c3c;
}
.tree > div:before,
.tree > div:after {
content: '';
position: absolute;
left: -25px;
width: 0;
height: 0;
border-left: 25px solid transparent;
border-right: 25px solid transparent;
}
.tree > div:before {
bottom: 100%;
border-bottom: 25px solid #e74c3c;
}
.tree > div:after {
bottom: calc(100% - 25px);
border-bottom: 25px solid #e74c3c;
}
</style>
</head>
<body>
<div class="tree">
<div></div>
</div>
</body>
</html>
```
希望这能帮到你! 如果你有任何问题,可以继续问我。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)