Auto-fill

noun

say it: “AW-toh FIL” /ˈɔtoʊ fɪl/

A keyword for repeat() that fits as many columns as there is room for and keeps empty columns when there aren't enough items, so the items keep their size.

What does auto-fill do in a grid?

auto-fill fits as many columns as there is room for, keeping empty columns if there aren't enough items.

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

In a sentence

  • “With auto-fill, my two bikes stayed card-sized and the rest of the row stayed empty.”

Level: Journeyman · More CSS terms at this level

Updated