As far as I know, in boostrap
is not possible with pure css. At some point in the documentation it says something like this:
If you're looking to present Pinterest-style miniature pictures, where are you
are of different heights and / or widths, you will have to use a
plugin from third parties, such as: Masonry , Isotope or Salvattore .
Since you have different dimensions in the images you leave an example using Masonry , is a library to make grillas that self-organize. Here you have an example made with this library.
To use Masonry in your fiddle
you must:
Include JQuery and Masonry:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/4.0.0/masonry.pkgd.js"></script>
Initialize the grid:
<script>
$('.grid').masonry({
// options
itemSelector: '.grid-item'
});
</script>
Here I modified your fiddle: link