CSS
What is CSS Grid?
A two-dimensional layout system for CSS that handles both rows and columns simultaneously.
CSS Grid Layout is a two-dimensional layout system that enables complex page layouts previously impossible or requiring hacks. Unlike Flexbox (one-dimensional), Grid works on both the row and column axes simultaneously.
Core Concepts
- Grid container: Element with
display: grid - Grid tracks: Rows and columns
- Grid lines: Dividing lines (numbered from 1)
- Grid cells: Intersection of row and column
- Grid areas: Named regions of the grid
Essential Properties
grid-template-columns— Define column sizesgrid-template-rows— Define row sizesgrid-column— Item column spangrid-row— Item row spangap— Space between tracks
Related Tools
Related Terms