3.4 · Layout

Masonry Layout.

Pinterest-style mosaic. Each tile is as tall as it needs to be; shorter items fill in below taller ones. CSS columns or Masonry.js.

What it is

Named after the way bricklayers stack bricks, a masonry layout arranges cards in columns where each card's height is determined by its content. Short items fill in below taller items in adjacent columns, rather than leaving empty space. This creates a Pinterest-style mosaic that feels organic and content-rich.

How it works

The simplest CSS approach uses the columns property: columns: 3 on the container makes content flow into 3 columns automatically, with each item taking only as much height as it needs. Items flow down the first column, then the second, then third. For more control, libraries like Masonry.js or Packery position each item manually.

Live demo

Filter by category. Notice how shorter tiles tuck under taller ones.

Live · filter

Field gallery

Concrete cathedral, Brutalism vol. 02
Black lake, north
Studio shoot, July
Marble stairs, library
Hannah, Reykjavík
Northern light study
Train station, dawn
Wheat field, midwest
Theo, backstage
Red corridor
Pine forest, late winter
Soraya, golden hour

Copy this prompt

Prompt · 3.4 Masonry
Build a photography portfolio gallery using masonry layout. Use CSS columns: 3 with column-gap: 12px on the container. Each image card should be display:inline-block, width:100%, margin-bottom:12px. Images should be different heights (some portrait, some landscape) to show the masonry effect clearly. Add a hover overlay on each image showing a brief caption and a zoom icon. On mobile (under 768px), reduce to columns:2. Under 480px, reduce to columns:1. Include a category filter bar at the top (All, Architecture, Portraits, Nature) that filters which images show.

Example sites to study