使用 flex 绘制一个三点骰子

实现效果:

.html:

<div class="container">
  <div class="item"></div>
  <div class="item"></div>
  <div class="item"></div>
</div>

.css:

.container {
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: space-between;
}
.item {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #000;
}
.item:nth-child(2) {
  align-self: center;
}
.item:nth-child(3) {
  align-self: flex-end;
}

更多 flex 语法参考

posted @ 2019-08-19 17:04  Leophen  阅读(408)  评论(0)    收藏  举报