On this page
  1. repeat()
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

repeat()

Prev: `minmax()` | Up: math | Next: color
Rel: math, Math & Sizing Functions Guide
Ref: MDN Web Docs — repeat()
Tags: #public #web #css #functions #math #tier/core


Syntax & Overview

repeat(auto-fit, minmax(16rem, 1fr))

Repeats Grid track patterns a fixed count or automatically (auto-fit / auto-fill).

Notes & Best Practices

Example

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

Linked from

Related notes