Grid Column Track Property

Last updated: 2026-09-13

grid-template-columns Grid Column Track Property

The grid-template-columns property defines the number and width of the column tracks in a grid container. By specifying the size of each column track you control the column structure precisely, which makes it one of the most central settings of CSS Grid. It supports fixed lengths, percentages, the fr unit, and powerful functions such as repeat() and minmax().

Category
Initial Valuenone
InheritedNo
Applies Toall
Animation Typediscrete
CSS VersionCSS3
StatusStandard

📝 Syntax

grid-template-columns: none | <track-list> | <auto-track-list>;

⚙️ Values

ValueTypeDescription
noneKeywordNo explicit column tracks
<track-list> | <auto-track-list>TypeTrack list
repeat()FunctionRepeated track definition

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
grid-template-columns v57 v16 v52 v10.1 v44
Supported in all major browsers
Tip: The fr (fraction) unit represents one share of the available space. For example, 1fr 2fr splits the remaining space between two columns at a 1:2 ratio.
Tip: repeat(3, 1fr) is equivalent to 1fr 1fr 1fr and is much more concise for many repeated tracks.

❓ FAQ

QWhat is the difference between grid-template-columns and grid-auto-columns?
Agrid-template-columns defines the explicitly declared column tracks, the main structure of the grid. grid-auto-columns controls the width of the implicit columns: when a grid item is placed beyond the explicit columns, the extra columns the browser creates automatically are implicit. For example, with only two defined columns, the third and later grid items land in implicit columns governed by grid-auto-columns.
QWhat does minmax(200px, 1fr) mean?
Aminmax() sets a range for the track size: a minimum of 200px and a maximum of 1fr. The column is at least 200px wide, stretches according to 1fr when there is room, and stays at 200px when space is tight. It is often combined with repeat(auto-fill, minmax(200px, 1fr)) so the browser decides the number of columns from the container width, giving a responsive grid without media queries.
QWhat is the difference between auto-fill and auto-fit?
ABoth work with repeat() to let the column count adapt to the container width. auto-fill creates as many columns as possible and keeps empty tracks even when there is no content to place in them, so the column widths stay stable. auto-fit collapses the empty tracks to 0 and lets the columns with content stretch to fill the whole row. At the same width, auto-fit produces wider content columns, which suits cards that should fill the line; auto-fill fits layouts that must keep a fixed column width.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏