liveBook · Manning

Fr unit

The CSS fr unit is a flexible Grid track-sizing unit representing a share of the grid container’s leftover free space.

How 4 Manning books explain it

Math for Web Design

The fr unit is a CSS Grid flexible length unit representing a share of available space after fixed track sizes and other deductions.

How it is used
Sizes CSS Grid tracks proportionally within responsive layouts after space is reserved for fixed tracks and gaps.
How deep it goes
Works through width calculations, then identifies content constraints and redistribution that complicate the simple formula.
Examples
Calculates mixed fixed-and-flexible columns, a minmax()-constrained pair, and a flexible track with no remaining space.
What you can do after
Apply it via CSS Grid to calculate proportional track widths and diagnose unexpected sizes or overflow.

Read how Math for Web Design explains fr unit →

CSS in Depth, Second Edition

The CSS fr unit represents a fraction of the leftover space in a grid container after non-flexible track sizes are accounted for.

How it is used
Defines proportional columns and rows when building CSS Grid layouts.
How deep it goes
Explains proportional sizing through worked layouts and mixed patterns, but stops short of browser sizing internals.
Examples
Uses equal three-column grids, fixed-plus-flexible columns, proportional page layouts, and repeated track patterns.
What you can do after
Build equal, proportional, mixed fixed-and-flexible, and repeated CSS Grid tracks with fr values.

Read how CSS in Depth, Second Edition explains fr unit →

Tiny CSS Projects

The fr unit is a CSS Grid sizing unit that represents a share of the available space remaining after minimum sizes are applied.

How it is used
Sizes CSS Grid rows or columns proportionally by distributing space remaining after minimum track sizes are satisfied.
How deep it goes
Explains proportional allocation with cake diagrams and declarations, but stops short of detailed Grid sizing internals.
Examples
Uses cake portions, equal and weighted fr columns, and a three-column project declaration previewed with grid lines.
What you can do after
Build flexible CSS Grid columns with proportional tracks, repeat(), minmax(), and fixed-size neighbors.

Read how Tiny CSS Projects explains fr unit →

Web Design Playground, Second Edition

The CSS fr unit is a flexible length unit representing a fraction of the free space in a grid container.

How it is used
Uses fr units to distribute free grid space and replace fixed column widths in liquid layouts.
How deep it goes
Explains proportional sizing, remaining-space behavior, row-height requirements, and conversion from pixel-based layouts.
Examples
Demonstrates 1fr, 1fr-to-3fr proportions, mixed pixel and fr columns, and repeat(3, 1fr) layouts.
What you can do after
Apply it via CSS Grid to build proportional columns and convert fixed-width layouts into liquid layouts.

Read how Web Design Playground, Second Edition explains fr unit →

Also covered in

What to know first

Related concepts

Questions about fr unit

What is fr unit?

The CSS fr unit is a flexible Grid track-sizing unit representing a share of the grid container’s leftover free space.

Which Manning books explain fr unit?

Math for Web Design, CSS in Depth, Second Edition, Tiny CSS Projects and Web Design Playground, Second Edition.

What should I know before learning fr unit?

Manning books that teach fr unit usually introduce flexbox, grid container, CSS Grid and max-content first.

What is fr unit part of?

Fr unit is part of CSS Grid. CSS Grid is a CSS layout system for arranging elements in two-dimensional rows and columns.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.