# Grids That Fill the Space: repeat(), minmax() and auto-fit

One line of CSS, repeat(auto-fit, minmax(14rem, 1fr)), makes a gallery that shows one column on a phone, four on a laptop and more on a wide screen, with no media query at all.

![Cheat sheet: Grids That Fill the Space: repeat(), minmax() and auto-fit](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/65f8be988b614742ba181f2f0511b764.webp)

- Category: CSS
- Level: Journeyman
- Tags: Auto-fill, Auto-fit, CSS, Implicit grid, minmax(), repeat()
- Updated: November 1, 2026

Source: https://www.ask-codey.com/cheat-sheets/css-grid-auto-fit-minmax-cheat-sheet
