ae python3d圣诞树
时间: 2023-12-19 09:32:24 浏览: 208
python圣诞树实现
以下是使用HTML+CSS+SVG绘制精美彩色闪灯圣诞树的示例代码:
```python
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #001f3f;
}
.tree {
position: relative;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid #2ecc40;
}
.tree:before {
content: '';
position: absolute;
top: 100px;
width: 150px;
height: 150px;
border-radius: 50%;
background-color: #2ecc40;
}
.tree:after {
content: '';
position: absolute;
top: 135px;
width: 120px;
height: 120px;
border-radius: 50%;
background-color: #2ecc40;
}
.light {
position: absolute;
width: 10px;
height: 10px;
background-color: #ffdc00;
border-radius: 50%;
animation: blink 1s infinite;
}
@keyframes blink {
50% {
opacity: 0;
}
}
.light1 {
top: 50px;
left: 45px;
}
.light2 {
top: 70px;
left: 60px;
}
.light3 {
top: 90px;
left: 75px;
}
</style>
</head>
<body>
<div class="tree">
<div class="light light1"></div>
<div class="light light2"></div>
<div class="light light3"></div>
</div>
</body>
</html>
```
请将上述代码保存为`christmas_tree.html`文件,然后在浏览器中打开以查看效果。
阅读全文