October 22, 2024
Chicago 12, Melborne City, USA
CSS

CSS-only masonry layout


I want to use CSS to align a series of images like the image shows. 2 columns, and any number of side by side images. No vertical gaps between the images. And all the images are displayed with the same width (whatever their original size), and the heights are adjusted to keep the original aspect ratio.

I have tried several online examples of similar things, but the images are always aligned so that there is a gap for images that have a smaller height, and the next row of images on each column and vertically aligned with each other, which is what I want to avoid.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video