<div class="container">
  <h2>使用 row-gap 设置行间距。</h2>
  <pre>
  row-gap: 20px;
</pre>
  <article class="a1">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </article>
</div>
.container {
  box-sizing: border-box;
  background-color: #f1f1f1;
  margin: 10px 0;
  text-align: center;
  overflow: hidden;

  article {
    margin: 0 auto;
    width: 300px;
    height: 200px;
    border: solid 5px silver;
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-template-columns: repeat(3, 1fr);
    row-gap: 20px;

    & > div {
      background: blueviolet;
      background-clip: content-box;
      padding: 10px;
      border: solid 1px #ddd;
    }
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js