使用纯css布局中一个“王”字

56 阅读1分钟

"```markdown

.container {
  width: 100px;
  height: 100px;
  position: relative;
}

.bar {
  position: absolute;
  width: 10px;
  height: 100px;
  background-color: black;
  top: 0;
  left: 45px;
}

.bar::before {
  content: \"\";
  position: absolute;
  width: 10px;
  height: 50px;
  background-color: black;
  top: 40px;
  left: 0;
}

.bar::after {
  content: \"\";
  position: absolute;
  width: 10px;
  height: 50px;
  background-color: black;
  top: 40px;
  right: 0;
}

.circle {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 10px solid black;
  top: 20px;
  left: 20px;
}

.circle::before {
  content: \"\";
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: black;
  border-radius: 50%;
  top: 10px;
  left: 10px;
}

.circle::after {
  content: \"\";
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: black;
  border-radius: 50%;
  top: 10px;
  right: 10px;
}