I have a list of blocks with various heights.
<div class="container">
<div class="block">
<div class="item">abcxyz</div>
<div class="item">abcxyz</div>
<div class="item">abcxyz</div>
</div>
<div class="block">
<div class="item">abcxyz</div>
</div>
...
</div>
I want them to flow in 3 columns using css column-count property. I don't want the blocks to be broken so I apply the column-break-inside: avoid. The problem is when it's applied then the columns' height division are very unequal.
.container {
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
height: 180px;
}
.block {
padding: 10px;
border-bottom: 2px solid #97979b;
-webkit-column-break-inside:avoid;
-moz-column-break-inside:avoid;
-o-column-break-inside:avoid;
-ms-column-break-inside:avoid;
column-break-inside:avoid;
}
See this codepen http://codepen.io/KwiZ/pen/PwmXPB. The height division could have been better, like when I set a fixed height for the container: http://codepen.io/anon/pen/emWbmm, but of course fixed height is bad and should be avoided. Why this happens and how to make the columns' height naturally equal?