<div class="parent">
  <div class="child"><div style="height:50px"></div></div>
  <div class="child"><div style="height:35px"></div></div>
  <div class="child"><div style="height:40px"></div></div>
  <div class="child"><div style="height:55px"></div></div>
  <div class="child"><div style="height:80px"></div></div>
  <div class="child"><div style="height:60px"></div></div>
</div>
div.parent {
  //display: flex;
  //flex-direction: row;
  //flex-wrap: wrap;
  //justify-content: center;
  max-width: 800px;
  
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  grid-gap: 8px;
}

div.child {
  //margin: 4px;
  display: flex;
  //width: 250px;
  background-color: grey;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.