# Masonry Columns

> An image-board style masonry layout using CSS multi-column. Works everywhere.

- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: masonry, columns, waterfall, gallery, multi-column
- Live preview: https://copy-css.com/snippets/masonry-columns
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="masonry">
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</div>
```

## CSS

```css
.masonry {
  columns: 3 200px; /* up to 3 columns, each at least 200px */
  column-gap: 16px;
}

.masonry > * {
  margin-bottom: 16px;
  break-inside: avoid;
}
```

## Notes

- This CSS Masonry Columns is 9 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
