JSFiddle - React, Tailwind, and code Playground

by Shridhar Baddur

HTML

<div class="paddingBlock">
  <h1>EQUAL HEIGHT COLUMNS WITH MARGINS IN MULTIPLE ROWS</h1>
  <p>Building on the above example, just give bottom margins to the boxes. Add a flex-wrap: wrap to the parent, so that boxes go to the next line when they run out of space in a 'row'.</p>
  <div class="equalHMRWrap eqWrap">
    <div class="equalHMR eq">boo</div>
    <div class="equalHMR eq">shoo</div>
    <div class="equalHMR eq">clue</div>
    <div class="equalHMR eq">boo <br> boo </div>
    <div class="equalHMR eq">shoo</div>
    <div class="equalHMR eq">clue</div>
  </div>
</div>

CSS

.paddingBlock {
	padding: 20px 0;
}
.equalHMRWrap {
	justify-content: space-between;
	flex-wrap: wrap;
}

.equalHMR {
	width: 32%;
	margin-bottom: 2%;
}

.eqWrap {
	display: flex;
}


.eq {
	padding: 10px;
}

.eq:nth-of-type(odd) {
	background: yellow;
}

.eq:nth-of-type(even) {
	background: lightblue;
}