Subgrid

It is a feature of CSS grid level 2 that allows a child grid to inherit the row or column definition from the parent grid.
  • Used in grid-template-rows or grid-template-columns with the value subgrid.
  • The subgrid must span a range of columns or rows from the parent.

Example

In this example, we can see how the content class inherits the column definition from the parent container. To achieve this, we use grid-column: 1 / -1, which makes it occupy all available columns, from the first to the last.

ResultLive
html
css