HTML/CSSBeginner#css#grid

Explain CSS Grid: grid-template-columns/rows and fr unit.

CSS Grid lays out children in two dimensions. grid-template-columns/rows define the track sizes; the fr unit represents a fraction of remaining free space, allowing flexible proportional columns without calculating percentages.

Example
.layout {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

Related Questions

1
HTML/CSSAdvanced#css#grid

How do you create a responsive grid without media queries using auto-fit/auto-fill?

Open
2
HTML/CSSIntermediate#css#grid

What is the difference between Flexbox and Grid, and when should you use each?

Open
3
HTML/CSSIntermediate#css#grid

What are grid-template-areas used for?

Open