下面是一个简单的 HTML 代码,表示一个圣诞树。你可以将这段代码复制粘贴到 HTML 文
件中,然后用浏览器打开查看。
html
Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Christmas Tree</title>
<style>
body {
background-color: #f0f0f0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.tree {
text-align: center;
color: green;
font-size: 24px;
}
.layer {
white-space: nowrap;
}
.star {
color: yellow;
font-size: 36px;
display: block;
margin-top: -15px;
}
</style>
</head>
<body>
<div class="tree">
<div class="layer">★</div>
<div class="layer">★★</div>