coderef

GridBaseline · Widely available

CSS grid is a two-dimensional layout system, which lays content out in rows and columns.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Oct 17, 2017. Widely available since Apr 17, 2020.

Browser support

DesktopChrome
1–56Not supported
57+Supportedsince Mar 9, 2017
Current: 155
Edge
12–15Not supported
16+Supportedsince Oct 17, 2017
Current: 154
Firefox
1–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157
Safari
1–10Not supported
10.1+Supportedsince Mar 27, 2017
Current: 27
MobileChrome Android
18–56Not supported
57+Supportedsince Mar 16, 2017
Current: 155
Firefox Android
4–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157
Safari iOS
1–10Not supported
10.3+Supportedsince Mar 27, 2017
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

CSS
.layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.layout > .featured {
  grid-column: span 2;
}

Feature detection

CSS · check before using
@supports (display: grid) {
  .layout { display: grid; }
}

Sub-features

Support for each part of the feature (61). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
align-content.context_grid57165210.1525210.3
align-items.context_grid57165210.1525210.3
align-self.context_grid57165210.1525210.3
column-gap.grid_context66166112666112
display.grid57165210.1575210.3
display.inline-grid57165210.1575210.3
gap57165210.1575210.3
gap.grid_context66166112666112
gap.grid_context.calc_values66166112.1666112.2
gap.grid_context.percentage_values66166112666112
gap.normal57165210.1575210.3
grid57165210.1575210.3
grid-area57165210.1575210.3
grid-auto-columns57167010.1577910.3
grid-auto-flow57165210.1575210.3
grid-auto-flow.column57795210.1575210.3
grid-auto-flow.dense57795210.1575210.3
grid-auto-flow.row57795210.1575210.3
grid-auto-rows57167010.1577910.3
grid-column57165210.1575210.3
Show 41 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
grid-column-end57165210.1575210.3
grid-column-start57165210.1575210.3
grid-row57165210.1575210.3
grid-row-end57165210.1575210.3
grid-row-start57165210.1575210.3
grid-template57165210.1575210.3
grid-template-areas57165210.1575210.3
grid-template-areas.none57795210.1575210.3
grid-template-columns57165210.1575210.3
grid-template-columns.auto57795210.1575210.3
grid-template-columns.fit-content57165210.1575210.3
grid-template-columns.max-content57795210.1575210.3
grid-template-columns.min-content57795210.1575210.3
grid-template-columns.minmax57165210.1575210.3
grid-template-columns.none57795210.1575210.3
grid-template-columns.repeat57167610.1577910.3
grid-template-rows57165210.1575210.3
grid-template-rows.auto57795210.1575210.3
grid-template-rows.fit-content57165210.1575210.3
grid-template-rows.max-content57795210.1575210.3
grid-template-rows.min-content57795210.1575210.3
grid-template-rows.minmax57165210.1575210.3
grid-template-rows.none57795210.1575210.3
grid-template-rows.repeat57167610.1577910.3
grid-template.none57795210.1575210.3
justify-content.grid_context57165210.1525210.3
justify-items.grid_context57164510.1574510.3
justify-self57164510.1574510.3
justify-self.auto57794510.1574510.3
justify-self.grid_context57164510.1574510.3
justify-self.left57794510.1574510.3
justify-self.normal57794510.1574510.3
justify-self.right57794510.1574510.3
justify-self.stretch57794510.1574510.3
place-content.grid_context59795311595311
place-items.grid_context59794511594511
place-self.grid_context59794511594511
row-gap47165210.1475210.3
row-gap.grid_context66166112666112
row-gap.normal47165210.1475210.3
<flex>29124010.1294010.3