grid

A shorthand property for setting all the explicit and implicit grid properties in a single declaration. It allows you to define rows, columns, and templates quickly.

It is documented as part of the CSS Grid Layout specification.

/* Usage Example */
.container {
  display: grid;
  grid: 100px 1fr / 1fr 200px;
  /* rows / columns */
}

/* Syntax */
grid: grid-template;
grid: grid-template-rows;
grid: auto-flow;
grid: dense;
grid: grid-auto-columns;
grid: grid-auto-rows;
grid: grid-template-columns;

/* Global values */
grid: inherit;
grid: initial;
grid: revert;
grid: revert-layer;
grid: unset;

This comparison shows how grid works in a real project. View snippet →

Widely available Since 2017 95% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2017.

57+
52+
10.1+
16+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC