First turn the element into a grid with display: grid (or inline-grid). Then use grid to define tracks and how extra items auto-place. The property is not inherited. Unspecified sub-properties reset to their initial values. gap is not reset by this shorthand.
Standard-track.
Not deprecated and not experimental. Baseline Widely available since 2017. Internet Explorer’s old -ms-grid model is a different, incomplete system—do not treat it as modern grid.
Flow columns.auto-flow 80px sets column flow and makes each new column 80px wide.
Fill down first. Items fill column by column: 1 then 2 in the first column, and so on.
Same idea as longhands. This matches setting grid-template-rows, grid-auto-flow: column, and grid-auto-columns: 80px.
Edge Cases & Pitfalls
Most surprises come from forgetting display: grid or what the shorthand resets.
display
Needs display: grid
The grid property alone does not create a grid. Set display: grid (or inline-grid) first.
reset
Unspecified parts reset
Like other shorthands, omitted sub-properties go back to their initial values. Set only what you mean, or use a longhand for a single change.
gap
gap is not reset
Gutters stay as set. Writing a new grid value will not clear gap.
or
Explicit or implicit, not a mix in one form
A single grid declaration uses either a template form or an auto-flow form. You cannot fully define both explicit axes and custom auto sizes in every combination at once.
ie
IE -ms-grid is not modern Grid
Internet Explorer’s prefixed model lacks auto-placement, fr, and modern areas. Do not expect this shorthand to work there.
Compatibility
Browser Support
The grid shorthand is a browser CSS property for Grid Layout. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
grid
Supported in Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. Internet Explorer does not support the modern shorthand.
97%Global support
Google Chrome57+
Full support
Mozilla Firefox52+
Full support
Apple Safari10.1+
Full support
Microsoft Edge16+
Full support
Opera44+
Full support
Samsung Internet6.2+
Full support
Internet ExplorerNo modern grid
Not supported
gridWidely supported
Bottom line: Safe in current browsers. Pair with display: grid. Prefer longhands when you only need one track or flow setting.
Remember
Key Takeaways
Role: shorthand for template tracks, areas, and auto-flow settings.
Needsdisplay: grid first. The shorthand does not create the container.
Forms:rows / columns, or auto-flow on one axis.
Gap stays. The shorthand does not reset gap.
One line:grid packs template and auto-flow settings into one declaration after you set display: grid.
Frequently Asked Questions
It is a shorthand that sets explicit grid tracks (template rows, columns, and areas) and implicit grid behavior (auto-flow, auto-rows, and auto-columns) in one declaration.
display: grid turns the element into a grid container. The grid property then defines how rows, columns, areas, and auto-placement work on that container.
No. According to the specification, gutter properties such as gap are not reset by the grid shorthand.
It turns on automatic placement along one axis. For example, grid: auto-flow / 1fr 1fr 1fr creates three columns and adds rows as needed for new items.
Use grid-template-columns, grid-template-rows, or grid-auto-flow alone when you only need to change one piece. The shorthand is handy when you set several of them together.
It is Baseline Widely available: Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. Internet Explorer does not support the modern shorthand. It is a browser CSS property, not a Node.js feature.