CSS grid-template-areas Property


The grid-template-areas property in CSS is used to specify the area within the grid layout. The named grid area can be rendered on the screen based on the sequence of values of the grid-template-areas property.

The grid-template-areas property specifies areas within the grid layout.

You can name grid items by using the grid-area property, and then reference to the name in the grid-template-areas property.

CSS Syntax

grid-template-areas: none|itemnames;
Property Values:
  • none: It is the default value and it does not contains grid named areas.
  • itemnames: It is the sequence of grid area names in the form of row and columns.

Note:

  • Each area name is separated by a space.
  • Each row is contained within single quote ‘ ‘.
  • There is a semicolon at the end of the declaration only.
  • Period represents items with no names.

Supported Browsers:

  • Firefox: 52.0, 2.0 -moz-
  • Google Chrome: 50.0, 4.0 -webkit-
  • Internet Explorer: 10.0
  • Safari: 9.0, 3.1 -webkit-
  • Opera: 37.0, 15.0 -webkit-, 11.1

Example -