可以使用 JavaScript 在网页中绘制一个圣诞树。这里是一个简单的示例:

<!DOCTYPE html>
<html>
<head>
  <style>
    #tree {
      height: 200px;
      width: 200px;
      background: green;
    }
    #star {
      height: 20px;
      width: 20px;
      background: yellow;
      border-radius: 50%;
      position: absolute;
      top: 0;
      left: 90px;
    }
    #trunk {
      height: 20px;
      width: 20px;
      background: brown;
      position: absolute;
      bottom: 0;
      left: 90px;
    }
  </style>
</head>
<body>
  <div id="tree"></div>
  <div id="star"></div>
  <div id="trunk"></div>
</body>
</html>

更多推荐