What I'm trying to do is a simple "masonry-like" grid. I have lets say 10 col-md-4
ina row
, so it will wrap in 4 line (last line with only 1 element). The problem is that the blocks are not of same height (and I don't want them to) so when a single block is slightly higher than the others in a row, the next row is ~10px bellow the tallest block and what I want is each element to be 10px bellow his upper block, regardless of its height.
Here is a screenshot and my code:
<div class="row centered" style="margin-top: 30px;">
{% for post in posts %}
<div class="show_post_box col-md-4 col-sm-6 col-xs-12" id="{{ loop.index }}">
<div class="box post show_posts">
{% if post.url is defined %}
<a href="{{ post.url }}">
<h2>{{ post.title }}</h2>
</a>
<p>{{ post.description }}</p>
{% else %}
{% from ("posts/" + post) import post_title, post_description %}
<a href="/posts/{{ post }}">
<h2>{{ post_title }}</h2>
</a>
<p>{{ post_description }}</p>
{% endif %}
</div>
</div>
{% endfor %}
</div>