Another answer involves using the display: table property in CSS. It is similar to table forests, but allows much more flexibility with CSS and has more browser support than flexbox.
HTML:
<div id="container"> <div class="row"> <div class="item"> Test </div> <div class="item"> Hello. Sample <br> Content <br> </div> </div> <div class="row"> <div class="item"> Test<br> Sample Content </div> <div class="item"> Test </div> </div> </div>
CSS
#container { width: 100%; display: table; } .row { display: table-row; } .item { background: #c4c4c4; width: 49%; box-sizing: border-box; border: 1px solid black; display: table-cell; }
Violin: http://jsfiddle.net/q5jyfuy6/
source share