-
Agent8
Hi,
I’ve been trying to apply a masonry effect to a query loop block in order to display art at the correct aspect ratio without massive gaps vertically. I’ve tried following this thread but am not getting a good result:
https://generate.support/topic/create-masonry-grid-with-query-loop/
I have tried adding bottom margin to the loop item but this creates the same problem as not having masonry. E.G. Margin fixes the first item but then all the others have a massive white margin at the bottom.
Can you point me in the right direction?
Thanks,
Nick. -
George
Hello,
Please remove any existing JS, set the query looper grid to 1 column, and give it a class of
css-masonry.Then, use this CSS:
.css-masonry { display: block !important; column-count: 3; column-width: 250px; column-gap: 40px; } .gb-loop-item { break-inside: avoid; margin-bottom: 40px }This sets a 3 column grid, but it will collapse to 2 or 1 when there isn’t space for the 250px column-width.
-
Agent8
Thats great. Thanks George. Fixed.
-
George
Glad to know, you are welcome!
- You must be logged in to reply to this topic.