<div class="parent">
  <div class="child child-1">Child 1</div>
  <div class="child child-2">Child 2</div>
  <div class="child child-3">Child 3</div>
  <div class="child child-4">Child 4</div>
  <div class="child child-5">Child 5</div>
  <div class="child child-6">Child 6</div>
  <div class="child child-7">Child 7</div>
  <div class="child child-8">Child 8</div>
</div>
.parent {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 150px);
  gap: 20px;
}

.child {
  padding: 20px;
  color: white;
  background-color: #0074d9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.child-1 {
  grid-column: 1;
  grid-row: 1;
}

.child-2 {
  grid-column: 1;
  grid-row: 2;
}

.child-3 {
  grid-column: 2;
  grid-row: 1;
}

.child-4 {
  grid-column: 2;
  grid-row: 2;
}

.child-5 {
  grid-column: 3;
  grid-row: 1;
}

.child-6 {
  grid-column: 3;
  grid-row: 2;
}

.child-7 {
  grid-column: 4;
  grid-row: 1;
}

.child-8 {
  grid-column: 4;
  grid-row: 2;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.