Skip to main content
Module 8 · Lesson 2 of 430/60 in the course~22 min
Module lessons (2/4)

Intrinsic Responsive Grids: repeat(auto-fit, minmax())

Lesson preview5 hands-on exercises readyModern HTML & CSS · CSS Grid Layout & Subgrid

Create overflow-safe multi-column card galleries with zero media queries via min(100%, 260px) and auto-fit.

What you'll learn in this lesson

  • Build self-adapting responsive card galleries with zero @media queries using repeat(auto-fit, minmax(...)).
  • Prevent sub-260px viewport overflow by wrapping the track minimum in min(100%, 260px).
  • Distinguish auto-fit (collapses empty trailing tracks so items stretch cleanly across the full row) from auto-fill (preserves empty reserved track slots).

Overview

Before intrinsic CSS Grid, responsive galleries required 3 separate media queries (1 col, 2 cols, 3 cols, 4 cols). Today one formula adjusts automatically to phones, tablets, sidebars, and 4K displays:

Sections covered in this lesson

  1. 1Responsive Card Grids in One Single Line of CSS
Pro Lesson · CSS Grid Layout & Subgrid

Unlock "Intrinsic Responsive Grids: repeat(auto-fit, minmax())" and the full Modern HTML & CSS curriculum

Create overflow-safe multi-column card galleries with zero media queries via min(100%, 260px) and auto-fit.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Modern HTML & CSS plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.