CSS Subgrid — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Subgrid lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Make the child a grid
easy10 minTurn .cell into its own grid container.
- 2
Inherit the parent columns
easy10 minUse subgrid so .cell reuses the parent's column tracks.
- 3
Span the parent tracks
easy10 minMake .cell span both parent columns.
- 4
Subgrid the rows
easy10 minUse subgrid on the row axis.
- 5
Subgrid with a gap
medium10 minSubgrid the columns and add a 10px gap inside.
Find the bug(5)
- 1
Fix the missing nested grid
easy8 minsubgrid only works on a grid container.
- 2
Fix the misspelled keyword
easy8 minThe value is subgrid, not sub-grid.
- 3
Fix the axis
easy8 minThe subgrid was declared on columns but rows were intended.
- 4
Fix the missing span
easy8 minA subgrid must span the parent tracks it inherits.
- 5
Fix the gap on the wrong element
easy8 minThe inner gap belongs on the subgrid container.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace