Pinterest/Masonry Layout- Where to...

User 2879936 Photo


Registered User
38 posts

Greetings! :)

I'm trying to figure out this layout for my webpage gallery:

https://forum.webflow.com/uploads/webflow1/original/3X/3/b/3b6a2037659ac26193fb873c953fe74fd3619712.jpg

I want to eliminate all white space, except for a few pixels for margin between pictures (as shown in the picture above ;)). The pictures vary in size.

I'm fiddling with flex box but getting lots of unwanted white space between certain photos. Is this layout possible with Grid (I have zilch experience with Grid)?

Anyone have any suggestions on where to begin?

Thank you!
Laura

User 2903050 Photo


Registered User
260 posts

Definitely will be able to create using grid. The white space would be created using column gap and row gap. The columns would be 1fr each but the rows would have to be varying height which would be the challenging bit. Do you have the pictures of varying heights?
User 2879936 Photo


Registered User
38 posts

Thanks for the quick reply Phil!

Yay! I’m glad to know it’s possible!

The photos are located here:

http://huttonfinebuilders.coffeecup.com/gallery.html

:)
User 2903050 Photo


Registered User
260 posts

Yes it's possible it's just getting the varying row height to play nicely.
User 122279 Photo


Senior Advisor
14,450 posts
Online Now

If you are more familiar with flex, take a look in my sharing folder (URL in signature) and check out the couple of galleries I have there. You probably have to look in the right-most column, the ones for SD3.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2903050 Photo


Registered User
260 posts

Hi Laura, after having a little play and search on the internet it is possible but its really difficult as CSS grid is really for 2D grids. We could try line based placement of your images but would need a lot of try and error so get rid of the white space.
Regards
User 244626 Photo


Registered User
811 posts

https://masonry.desandro.com/
Bootstrap 5 CSS Grid.
User 2879936 Photo


Registered User
38 posts

Inger! Your "Masonry 'Brick work' gallery" component saved me! That was exactly what I was looking for! THANK YOU!

And big thank you Phil and Twinstream for your help as well!!! :)
User 122279 Photo


Senior Advisor
14,450 posts
Online Now

Great! Glad I was able to help! :)
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.