so I have 4 divs (I actually have a lot more, but that will simplify the question). I want to show them in two columns. 4 divs vary in height. the number of actual divs at the end will vary. so if i have this
<div id="1" style="height: 200px" class="inline">some content here</div>
<div id="2" style="height: 600px" class="inline">some content here</div>
<div id="3" style="height: 300px" class="inline">some content here</div>
<div id="4" style="height: 200px" class="inline">some content here</div>
with style that way
.inline { display: inline-block; vertical-align: top; width: 48%;}
so # 1 will go left and then # 2 will bounce right next to it, great, but # 3 will not slide up 400 pixels to fit each other below # 1. (of course) ... it comes with left side, but 600 pixels from the top, clearing the bottom of No. 2. etc.
how could I make divs move to empty spaces, is this possible with css? Maybe jquery? I know that I can write div columns to label it, but since the number of divs is constantly changing and the height depends on the content. It would be nice to just get rid of the space, since we really do not care about the order.
any thoughts?
source
share