Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

thumbnails with different heights: is the behavior I get correct?

I'm using bootstrap to create a grid of div thumbnails with different heights. The code is something that follows this structure:

<div class="row">
    <ul class="thumbnails">
        <li class="span4">
            <div class="thumbnail">
                content here
            </div>
        </li>
        <li class="span4">
            <div class="thumbnail">
                content here
            </div>
        </li>
        <li class="span4">
            <div class="thumbnail">
                content here
            </div>
        </li>
    </ul>
</div>

of course each thumbnail has a different content, and I have different heights as a result. What I obtain is this:

enter image description here

as you can see, between the first and second there's an empty anti-aesthetic,unsmart hollow space. Is this normal? Is the code I'm writing well structured? How could I avoid this behavior? I've read a hint telling that the right thing to do is to add a row every three thumbnails, then close the row and insert three more thumbnails and so forth. But IMHO I think it's not the right thing to do, because nothing could pile up and I couldn't get the magic of bootstrap. Any piece of suggestion is welcome :-)

like image 876
Bertuz Avatar asked Sep 27 '13 00:09

Bertuz


1 Answers

Yes, that behavior is expected. You could use a plugin such as jQuery Isotope (https://github.com/desandro/isotope) or Masonry to get the images fill in the white space.

Here is a demo of Isotope + Bootstrap thumbnails:

http://bootply.com/61482

like image 175
Zim Avatar answered Sep 28 '22 15:09

Zim