如何用间距和重复来定义点

时间:2018-01-31 19:04:05

标签: javascript jquery

我想画圆点或圆圈如何有一个圆圈或圆点的边框。如何定义间距和重复。请看我的照片。

    <div class="dots1"></div>
    <div class="dots2"></div>
    <div class="dots3"></div>

enter image description here}

  :root {
      --diameter1: 0px;
      --diameter2: 0px;
      --diameter3: 0px;


.dots1, .dots2, .dots3 {
  border-image:url('border-image.png') 8 repeat;
  position: fixed;
  bottom: 0px;
  top: 50px;
  background: rgba(80, 219, 229,0.25);
  transform: translateY(50);
}


.dots1 {


}

.dots2 {

}

.dots3 {

}
  • 重复????八次&amp; 50px间距

1 个答案:

答案 0 :(得分:1)

您可以使用 css网格

执行此操作

body {
  margin: 40px;
}

.wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: repeat(8, 50px);
  grid-gap: 50px;
}

.box {

  padding: 10px;
  font-size: 150%;
  display: flex;
  align-items: center;
  justify-content: center;
}


.dot {
  background-color: #000;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
<div class="wrapper">
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
  <div class="box"><div class="dot"></div></div>
</div>