小编mar*_*so2的帖子

在CSS中创建星空背景

我正在制作一个纯代码的太阳能系统网站,没有使用图像.问题是我无法弄清楚如何在后台获得星星.我试图在黑色背景上得到像黄色展开的波尔卡圆点图案.这是我的代码(为每个其他星球重复div和样式).

html,
body {
  width: 100%;
  height: 100%;
  background-color: black;
}
#sun {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 200px;
  width: 200px;
  margin-top: -100px;
  margin-left: -100px;
  border-color: orange;
  border-width: 2px;
  border-style: solid;
  border-radius: 50%;
  box-shadow: 0 0 64px yellow;
  background-color: yellow;
}
#mercury {
  position: absolute;
  top: 0;
  left: 50%;
  height: 10px;
  width: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  background-color: #ffd9b3;
}
#mercury-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 260px;
  margin-top: -130px;
  margin-left: -130px; …
Run Code Online (Sandbox Code Playgroud)

html css

7
推荐指数
2
解决办法
5577
查看次数

标签 统计

css ×1

html ×1