The grid shorthand sets all explicit grid properties (grid-template-rows/columns/areas) AND all implicit grid properties (grid-auto-rows/columns/flow) in one declaration. Does not reset gap properties. Preferred over grid-template when auto-flow is involved..grid {
grid: auto 1fr / auto 1fr auto;
}.gallery {
grid: auto-flow 200px / repeat(4, 1fr);
}noneAll longhands reset to their initial values (default).auto-flowKeyword enabling the implicit grid with grid-auto-flow.denseKeyword combined with auto-flow — dense packing of holes.min-contentTrack size is the minimum size required by the content.max-contentTrack size is the maximum size the content needs without wrapping.autoTrack size is determined automatically based on content and available space.auto-fillFills the row/column with as many tracks as fit — including empty tracks.auto-fitFills the row/column with as many tracks as fit — empty tracks collapse to zero.subgridThe grid adopts the parent grid's tracks instead of defining its own.CSS Grid Layout Module Level 2Editor's DraftW3CMDN123456Show all codeEdit CSS onlineThe plugin that remembers hundreds of CSS items for youEvery CSS property — in a live demonstrationThe bilingual CSS referencedefinitionexamplessyntaxmodulespecificationsourcesvisual demonstrationpreviousnext