JSFiddle - React, Tailwind, and code Playground
HTML
<div class="flex-container">
<div class="flex-item">1</div>
<div class="flex-item">2</div>
<div class="flex-item">3</div>
<div class="flex-item">4</div>
<div class="flex-item">5</div>
</div>
CSS
.flex-container {
align-content: space-between;
align-items: flex-start;
display: flex;
flex-flow: row wrap;
justify-content: flex-start;
}
.flex-item {
background: tomato;
width: 31%;
height: 150px;
line-height: 150px;
color: white;
font-weight: bold;
font-size: 3em;
text-align: center;
}
.flex-item:not(:nth-of-type(-1n + 3)) {
margin-top: 3.2vw;
}
.flex-item:not(:nth-of-type(3n + 3)) {
margin-right: 3.2vw;
}