0Pricing
CSS Academy · Lesson

Layout Inspector for Flexbox and Grid

Visualize flex and grid tracks, gaps, and item alignment using Chrome's layout inspector overlay.

Layout Inspector for Flexbox and Grid is a free CSS Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the CSS Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Flexbox Badge in DevTools

Chrome DevTools marks flex containers with a "flex" badge next to their DOM node in the Elements panel. Clicking the badge toggles the Flexbox overlay — colored lines showing main axis, cross axis, item boundaries, and gap spacing.

Grid Badge and Overlay

Grid containers show a "grid" badge. Clicking it toggles the grid overlay: colored lines for columns, rows, and gaps. Persistent overlays (pinned in Layout panel) stay visible as you scroll or resize the viewport.

Layout Panel

DevTools → Elements → Layout tab lists all flex and grid containers on the page. Clicking a container name selects it in the DOM and toggles its overlay. Overlay appearance (line color, label visibility, track sizes) is configurable here.

Grid Track Sizing

The overlay shows track names and sizes when "Show track sizes" is enabled. Intrinsic sizes (auto, min-content, max-content) and fractional units (fr) display their resolved pixel values — revealing how fr units divide available space.

Flexbox Item Inspection

Select a flex item (child of a flex container). The Styles panel shows flex: shorthand expansion — flex-grow, flex-shrink, flex-basis. The overlay highlights the item's main-axis size, basis, and any growth or shrinkage applied.

Named Grid Areas

Grid containers with grid-template-areas show named area overlays. Each named region is labeled and color-coded. This visual makes it easy to verify grid-area assignments match the intended layout template.

Subgrid Inspection

Subgrid support in DevTools marks subgrid containers distinctly. Their track lines align with the parent grid tracks — the overlay shows this alignment visually, confirming that subgrid items participate in the parent grid's coordinate system.

Debugging Alignment

Misaligned items often result from wrong justify-content, align-items, or align-self values. The flex/grid overlay shows item positions relative to axis lines. Try toggling alignment properties in the Styles panel and observe overlay changes in real time.

Gap Visualization

The overlay renders gap spacing as colored bands between items. This makes it easy to confirm gap values and identify whether spacing comes from gap (correct) or from margin (which may collapse unexpectedly in flex rows).

Implicit vs Explicit Grid

Grid overlay differentiates implicit tracks (auto-created for overflow items) from explicit tracks (defined in grid-template). Dashed lines mark implicit tracks. If content creates unexpected implicit tracks, the overlay reveals the overflow pattern immediately.

Responsive Layout Debugging

Combine the Layout Inspector with Device Mode. Resize the viewport and watch how flex wrap and grid auto-fill/auto-fit tracks reflow in real time. This catches responsive layout breaks earlier than resizing a browser window manually.

Knowledge Check

What does the DevTools grid overlay show that is not visible in the rendered page?

Summary

The DevTools Flexbox and Grid Layout Inspector visualizes axis lines, track sizes, gap spacing, named areas, and implicit tracks as interactive overlays. Combined with the Layout panel for overlay management, it makes debugging complex CSS layouts faster and more intuitive than reading CSS alone.

Frequently asked questions

Is the “Layout Inspector for Flexbox and Grid” lesson free?

Yes — the full text of “Layout Inspector for Flexbox and Grid” is free to read here on the web, and the CSS Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the CSS Academy course, upgrade to CoddyKit PRO.

What will I learn in “Layout Inspector for Flexbox and Grid”?

Visualize flex and grid tracks, gaps, and item alignment using Chrome's layout inspector overlay. You practise CSS Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start CSS Academy?

No prior experience is required. CSS Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Layout Inspector for Flexbox and Grid” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this CSS Academy lesson?

Yes. Every CSS Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Computed Styles and Box Model Inspector
  2. Layout Inspector for Flexbox and Grid
  3. CSS Overview Panel
  4. Animations and Transitions Debugger
← Back to CSS Academy