圣诞树网页代码的礼物
时间: 2023-12-14 17:34:01 浏览: 52
以下是一个简单的圣诞树网页代码,其中包含了礼物的图案:
```html
<!DOCTYPE html>
<html>
<head>
<title>Christmas Tree</title>
<style>
body {
background-color: #1c1c1c;
}
.tree {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 200px;
height: 300px;
background-color: #006400; border-radius: 10px;
box-shadow: 0 0 10px #006400;
overflow: hidden;
}
.tree:before {
content: "";
position: absolute;
top: -50px;
left: -50px;
width: 300px;
height: 300px;
background-color: #006400;
border-radius: 50%;
box-shadow: 0 0 10px #006400;
}
.tree:after {
content: "";
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 100px solid transparent;
border-right: 100px solid transparent;
border-bottom: 150px solid #228b22;
}
.gift {
position: absolute;
top: 70%;
left: 50%;
transform: translate(-50%, -50%);
width: 50px;
height: 50px;
background-color: #b22222;
border-radius: 10px;
box-shadow: 0 0 10px #b22222;
overflow: hidden;
}
.gift:before {
content: "";
position: absolute;
top: -10px;
left: -10px;
width: 70px;
height: 70px;
background-color: #b22222;
border-radius: 50%;
box-shadow: 0 0 10px #b22222;
}
.gift:after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 30px;
height: 30px;
background-color: #ffd700;
border-radius: 50%;
box-shadow: 0 0 10px #ffd700; }
</style>
</head>
<body>
<div class="tree"></div>
<div class="gift"></div>
</body>
</html>
```
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.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)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)