I know this is an old question, but still not able to get any workable css solution.
The boxes should grow in height to accommodate all the dynamic content. The box with the maximum height should set the height of all the other boxes, so that all get the same height.
Note:
1) It should work till IE-8. And there could be too many boxes so dont limit it to 2 or 3 boxes.
2) I tried padding-bottom, negative margin bottom and table cell method. Cant use flex box as it wont support to IE9.
3) Cant change the HTML structure.
HTML:
<ul>
<li>
<div class="tile">
<div class="img"><img src="http://placehold.it/100x50">
</div>
<div class="name">
Lorum Ipsum Lorum
</div>
</div>
</li>
<li>
<div class="tile">
<div class="img"><img src="http://placehold.it/100x50">
</div>
<div class="name">
Lorum Ipsum Lorum Lorum Ipsum Lorum
</div>
</div>
</li>
<li>
<div class="tile">
<div class="img"><img src="http://placehold.it/100x50">
</div>
<div class="name">
Lorum Ipsum Lorum Lorum Ipsum Lorum
</div>
</div>
</li>
<li>
<div class="tile">
<div class="img"><img src="http://placehold.it/100x50">
</div>
<div class="name">
Lorum Ipsum Lorum
</div>
</div>
</li>
<li>
<div class="tile">
<div class="img"><img src="http://placehold.it/100x50">
</div>
<div class="name">
Lorum Ipsum Lorum
</div>
</div>
</li>
</ul>
CSS:
ul{
margin:0;
padding:0;
width:600px;
margin:0 auto;
border:#999 solid 1px;
border-bottom:none;
border-right:none;
overflow:hidden;
}
li{
float:left;
list-style:none;
width:25%;
padding:0;
margin:0;
box-sizing:border-box;
border-right:#999 solid 1px;
border-bottom:#999 solid 1px;
text-align:center;
padding:5px;
}
example: http://codepen.io/anon/pen/GFeoc