0

I have a grid layout using Bootstrap where each div has a different height. Once I overflow onto the next row, I'd like my divs to tessellate rather than clearing the tallest item from the previous row. In my bootply, you can see the div on the second row clears the last items height in the first row.

I'd like that div to move up, directly under the first item in the first row

Jeremy Thomas
  • 6,240
  • 9
  • 47
  • 92

1 Answers1

0

With the help of this question: stackoverflow.com/questions/19244268 I was able to make the masonry plug in respond to screen width by adding media queries for their .grid-sizer element:

.grid-sizer,
.grid-item {
  width: 50%;
}

@media (min-width: 768px) { 
    .grid-sizer,
    .grid-item {
        width: 50%; 
    }
}
@media (min-width: 992px) { 
    .grid-sizer,
    .grid-item {
        width: 33%; 
    } 
}
@media (min-width: 1200px) { 
    .grid-sizer,
    .grid-item {
        width: 25%; 
    } 
}
@media (min-width: 1600px) { 
    .grid-sizer,
    .grid-item {
        width: 20%; 
    } 
}
Jeremy Thomas
  • 6,240
  • 9
  • 47
  • 92