CSS gap Property Explained

What the CSS gap property does, with an example.

Published November 4, 2026

The CSS gap property sets the spacing between rows and columns in a flex or grid container.

Key points

  • Check browser compatibility on a resource like caniuse.com if targeting older browsers

Example

gap: 16px;
More CSS articles