Grid by Example

Everything you need to learn CSS Grid Layout

The subgrid can override the gap on the parent

The subgrid inherits the gap set on the parent grid by default. You can give a subgridded item different gap, row-gap or column-gap properties however. In this example the parent has a 10px gap set, the subgrid has row-gap set to 0.

Read the specification | View example as full page

See the Pen Grid by Example 2.4: row-gap set to 0 on the subgrid by rachelandrew (@rachelandrew) on CodePen.