Inspecting Grids with Browser DevTools
What you'll learn: How to use your browser's built-in tools to see the invisible structure of CSS Grid layouts while you build them.
Why Grid Inspection Matters
When you create a grid with display: grid, grid-template-columns, and other properties, the grid lines, tracks, and cells are invisible on the page. You see your content, but not the underlying structure that positions it. This makes debugging and understanding your layout challenging.
Modern browsers solve this problem with grid overlays — visual debugging tools that draw your grid structure directly on top of your page.
How to Inspect Grids
In Chrome, Edge, or Firefox:
- Right-click any grid container and select "Inspect"
- In the Elements/Inspector panel, look for a small grid badge (often labeled "grid") next to elements with
display: grid - Click the badge to toggle the grid overlay
The overlay typically shows:
- Numbered grid lines (the boundaries between tracks)
- Track sizes (widths and heights)
- Grid gaps (spacing between tracks)
- Grid areas (if you've defined named regions)
What You Can See
The grid overlay reveals exactly how your fr units calculated, where automatic placement put items, how grid-auto-flow filled the grid, and whether your tracks are sized as expected. You can see gaps rendered as colored spacing and distinguish explicit grid tracks from implicit ones.
Think of it like X-ray vision for your layout — suddenly the invisible scaffolding becomes visible.
Development Workflow
Toggle the grid overlay on while adjusting properties, then toggle it off to see the final result. This back-and-forth helps you understand how changes to grid-template-columns, gap, or grid-auto-flow affect the structure.
Key Takeaway: Browser DevTools grid overlays make invisible grid structure visible, showing you lines, tracks, and gaps so you can debug and understand your layouts as you build them.