CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise


CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

CSS grid template columns Property

CSS grid-template-columns Property



The grid-template-columns property is used to define the number and the width of columns in a grid layout. Its values are a space-separated list, where each value specifies the size of the respective column.


Default Value:-


Its default value is none.




Its syntax is:- grid-template-columns: none | auto | max-content | min-content | length | initial | inherit;


Further Explanation:-


Value Description
none Columns are created if needed.
auto The size of the columns is determined by the size of the container and size of the content of the items in the column
max-content Sets the size of each column to depend on the largest item in the column
min-content Sets the size of each column to depend on the smallest item in the column
length Sets the size of the columns using a length value.
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Code Explanation

All Tutorials related to CSS Properties

All Sections related to CSS