Challenging Image Gallery / Grid Layout (Same Height / Horizontal Masonry)
Maybe someone can help me with my problem. I am trying to build a same-height grid layout. Something like a horizontal masonry grid.
Here is an example:
I have already tried it with Flexbox but I couldn’t achieve the desired result. The whole gallery should of course stay inside the container and not protrude.
The goal would be to have variable columns and fixed rows, so that pictures in a row with different aspect ratios always have the same height.
“Contain” is not an option, as the images are cropped here.
In principle, it is also the same grid that Google uses for Google Images:
I would be grateful for any help!