---
source: https://iinventedlight.com/library/notes/css-subgrid.md
title: "CSS subgrid: share parent tracks with a nested grid"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (web.dev); CC-BY-4.0 (web.dev); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: web.dev, CSS subgrid; web.dev, CSS Grid. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: css-subgrid"
tags: [css, grid, subgrid, layout, alignment]
client: Librarian
sources:
  - id: S1
    title: "CSS subgrid"
    publisher: web.dev
    url: https://web.dev/articles/css-subgrid
    accessed: 2026-11-23
    license: "CC-BY-4.0"
  - id: S2
    title: "CSS Grid"
    publisher: web.dev
    url: https://web.dev/learn/css/grid
    accessed: 2026-11-23
    license: "CC-BY-4.0"
---
# CSS subgrid: share parent tracks with a nested grid
**Answer:** With subgrid, track sizing, templates and names can be shared with nested grids. A nested grid can inherit track sizing, line names, and gap from its parent grid. Set grid-template-columns to subgrid to use the parent's columns.

## Why subgrid exists

CSS grid is a very powerful layout engine.

This feature is now available in all three major browser engines. It became Baseline Newly available as of September 15, 2023.

Tracks created on a parent grid can only position direct children of the grid container.

With subgrid, track sizing, templates and names can be shared with nested grids.

Author defined named grid areas and lines were lost on any element that was not a direct child.

## Inheriting tracks from the parent

Any grid item can also become its own grid container by adding display set to grid.

To use the parent's grid columns on a nested grid, set grid-template-columns to subgrid.

By default, this nested grid has its own track sizing, separate from the parent grid.

With subgrid, a child grid container will inherit track sizing, line names, and gap from the parent.

To use the parent's grid rows, set grid-template-rows to subgrid. Shared grid lines then make it easier to align items.

## See also

- [css-grid-basics](https://iinventedlight.com/library/notes/css-grid-basics/)
- [css-layout](https://iinventedlight.com/library/notes/css-layout/)
- [css-flexbox-basics](https://iinventedlight.com/library/notes/css-flexbox-basics/)

## Claims

- id: C1
  claim: Subgrid can share track sizing, templates, and names with nested grids.
  source: S1
  evidence: "track sizing, templates and names can be shared with nested grids"

- id: C2
  claim: Parent tracks can only position direct children of the grid container.
  source: S1
  evidence: "only be used to position direct children of the grid container"

- id: C3
  claim: A child grid can inherit track sizing, line names, and gap from the parent.
  source: S2
  evidence: "inherit the track sizing, line names, and gap from the parent grid"

- id: C4
  claim: Set grid-template-columns to subgrid to use the parent's columns.
  source: S2
  evidence: "grid-template-columns: subgrid"

## Sources

- [S1] CSS subgrid. web.dev. https://web.dev/articles/css-subgrid . License: CC-BY-4.0. Accessed 2026-11-23.

- [S2] CSS Grid. web.dev. https://web.dev/learn/css/grid . License: CC-BY-4.0. Accessed 2026-11-23.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, CSS subgrid; web.dev, CSS Grid. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
