Example

A simple grid-template-columns property example:

Laboratory

description & Usage

To determine the number and width of columns in a grid layout, we use the grid-template-columns property.

Informations

# Description
Default Value none
Inherited no
Animatable yes
Version CSS Grid Layout Module Level 1
JavaScript syntax object.style.gridTemplateColumns="50px 50px 50px"

Browser compatibility and Support

# Chrome Edge Firefox Safari Opera
grid-template-columns

Syntax

Values

Values Description
none Default
auto Automatically determines the size of the columns.
max-content Calculates the size of the columns relative to the largest column on that page.
min-content It calculates the size of the columns relative to the smallest column in that page.
length Calculates the size of the columns relative to the legal length set on that page.
initial Adds this value to its default property.
inherit It inherits this value from its parent tag.