The fr Unit — Fractions of Free Space
The fr unit is unique to CSS Grid and represents a fraction of the remaining space after fixed and content-sized tracks are calculated. In grid-template-columns: 200px 1fr 2fr, the browser first allocates 200px to the first column, then divides the leftover space in a 1:2 ratio. On a 1200px container, that means 200px + 333px + 667px. Unlike percentages, fr units automatically account for gaps: grid-template-columns: 1fr 1fr 1frwith a 20px gap gives each column exactly (containerWidth - 40px) / 3 — no manual math required.