Skip to main content

Practice ยท 2 of 2

Grid That Fits Itself

Replace fixed column counts with the responsive one-liner: .gallery uses grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) โ€” as many 180px-minimum columns as fit, each sharing space equally. Rules: - Keep display: grid and gap: 1rem. - Swap the template to the auto-fit form.

Difficulty: beginner

Back to lesson: Practice: CSS Grid โ€” Practice