Here’s another useful flexbox tutorial for adaptive photo layout with flexbox. You’ll take a look at a super lightweight way to create a horizontal masonry effect for a set of arbitrarily-sized photos. Throw any set of photos at it, and they will line up edge-to-edge with no gaps anywhere.
The solution is not only lightweight but also quite simple. You’ll be using an unordered list of images and just 17 lines of CSS, with the heavy lifters being flexbox
and object-fit
.
Adaptive Photo Layout with Flexbox Demo:
Check out this Pen!
GIPHY App Key not set. Please check settings