Andrew's Digital Garden

CSS Grid's auto-fill vs auto-fit

auto-fill fills the row with as many columns as possible, even if there is no content to put in those columns. auto-fit fits the current content into as many rows as needed.

In practice, this means auto-fill will create empty 'ghost' columns, auto-fit makes stretchy columns.

css-grid-auto.png

[[css]] [[cssgrid]] [[layout]]

CSS Grid's `auto-fill` vs `auto-fit`