html – How to make image widths adapt but heights remain equal in each row-ThrowExceptions

Exception or error:

I would like to create a fluid responsive image thumbnail gallery, (as in Squarespace “Wexley” template), where the various image widths always adapt so that the heights are always equal along each row.

It is fully responsive so there are no fixed dimensions for the images. The images are of different aspect ratios, some landscape and some portrait. The images must not be cropped or distorted.
Depending on wether the images are wide or narrow, the number of images will always vary in each row, and the number of images on a row adapt with the responsive window. There is always equal space-between images.

I do not know if this technique uses “Flexbox” or “CSS Grid Layout”.

See visual reference:
visual example

or reference:

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *