create class have same height with parent
.box { display: inline-block; } .box:nth-child(1) { background: red; } .box:nth-child(2) { background: green; } .box:nth-child(3) { background: blue; } .container { width: 100px; height: 100px; } .container-2 { width: 200px; height: 200px; }