Erick what I got about your question is the Grid Layout Masonry which is about the same as the Waterfall of the RBoschini response, it's well implemented here .
Initially, it's done with Jquery , but there's a way to do it with CSS only.
From your example I've done the following, since you're using the Bootstrap% class and this is equivalent to a breakpoint of at least 970px , so I created a Media querie with these settings:
@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's inside col-md-6
is what will do magic, .container
of css. The problem is that there is apparently a conflict of this with Bootstrap, and the fact that it makes a cut in column
. The way to solve is by applying divs
, overflow: auto
in height: 100%
and still within .container
apply to article a querie
and break-inside: avoid-column
. It 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 that's all very relative so test it on your model and let me know anything ...