Erick what I’ve achieved regarding your doubt is the call Layout Grid Masonry which is almost the same thing as the Waterfall of Rboschini’s response, it is well applied here.
Initially, he is done with Jquery, but there is a way to be done with CSS only.
From your example I did the following, as you are using the class col-md-6
Bootstrap and this is equivalent to a breakpoint of at least 970px, so I created a Media querie with these definitions:
@media (min-width: 970px) {
.container {
-moz-column-count: 2;
-moz-column-gap: 10px;
-moz-column-width: 50%;
-webkit-column-count: 2;
-webkit-column-gap: 10px;
-webkit-column-width: 50%;
column-count: 2;
column-gap: 10px;
column-width: 50%;
}
}
What is inside the .container
is what will make the magic, the column
css. The problem is that apparently there is a conflict of this with Bootstrap, and the fact that it cuts divs
. The way to solve it is by applying a overflow: auto
, one height: 100%
in the .container
and still within the querie
apply to article one break-inside: avoid-column
and a -webkit-column-break-inside: avoid
. Would look like this:
@media (min-width: 970px) {
.container {
margin: 2em 0;
overflow: auto;
height: 100%;
-moz-column-count: 2;
-moz-column-gap: 10px;
-moz-column-width: 50%;
-moz-column-fill: auto;
-webkit-column-count: 2;
-webkit-column-gap: 10px;
-webkit-column-width: 50%;
-webkit-column-fill: auto;
column-count: 2;
column-gap: 10px;
column-width: 50%;
column-fill: auto;
}
article{
break-inside: avoid-column;
-webkit-column-break-inside: avoid;
}
}
Jsfiddle
Jsfiddle Fullscreen
But this is all very relative so test it on your model and let me know anything...
I tried to use this Waterfall but it changes the width of my box leaving small and disfigure my layout, I will try to do the same in your example.
– user27585
Poutz tried to make his example here, gave more or less certain still has an error ... look at the image http://ap.imagensbrasil.org/image/pUQCS ... the text box should be whole on the right side and the picture boxes one on top of the other.
– user27585
I’m trying to use Waterfall now but I can’t leave it with two columns kind ta working but the boxes get very small and do not get two columns
– user27585