圣诞树祝福html网页代码
时间: 2023-12-20 12:05:23 浏览: 191
```html
<!DOCTYPE html>
<html>
<head>
<style>
.tree {
text-align: center;
color: green;
font-size: 30px;
margin-top: 50px;
position: relative;
}
.tree:before, .tree:after {
content: '';
position: absolute;
top: 0;
width: 0;
border: 5px solid transparent;
border-bottom-color: green;
}
.tree:before {
left: 50%;
border-left: 5px solid green;
border-right: 5px solid green;
transform: translateX(-50%);
}
.tree:after {
right: 50%;
border-left: 5px solid green;
border-right: 5px solid green;
transform: translateX(50%);
}
.tree p {
margin: 20px 0 0;
}
</style>
</head>
<body>
<div class="tree">
<p>祝福语:自定义祝福语内容</p>
</div>
<button onclick="submitWish()">送出祝福</button>
<script>
function submitWish() {
var wish = prompt("请输入您想要表达的祝福语:");
document.querySelector('.tree p').innerText = "祝福语:" + wish;
}
</script>
</body>
</html>
```
阅读全文