CSS Grid is a two‑dimensional layout system that lets you define rows and columns directly in your stylesheet. It gives you precise control over where each element sits on the page, without needing extra wrapper elements or complex floats.
Also called: CSS Grid Layout
Why it matters
Using CSS Grid means a client gets a site that adapts cleanly to any screen size, reducing the need for redesigns and keeping maintenance costs low. It also shortens development time, which keeps the project within budget.
How it works
When a container is given display: grid, the browser creates an invisible grid based on the values of properties such as grid-template-columns, grid-template-rows, and grid-area. Child elements are then placed into the defined grid cells, and the browser calculates the final positions during the layout phase.
The mistake people make
A common error is applying grid to a layout that only needs a single axis, or neglecting a fallback for browsers that do not support it. This can cause items to stack incorrectly or disappear, breaking the page’s appearance for some users.