Fr unit
The CSS fr unit is a flexible Grid track-sizing unit representing a share of the grid container’s leftover free space.
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.
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.
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.
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
- flexboxFlexbox is a CSS one-dimensional layout model for arranging, sizing, aligning, and distributing items along a row or column.
- grid containerA grid container is an element whose display mode establishes a CSS Grid formatting context for laying out its child elements as grid items.
- CSS GridCSS Grid is a CSS layout system for arranging elements in two-dimensional rows and columns.
Related concepts
- expressionuses · An expression is a syntactically formed combination of values, names, operators, or other terms that denotes or evaluates to a value or result.
- CSS Gridpart of · CSS Grid is a CSS layout system for arranging elements in two-dimensional rows and columns.
- fluid layoutused by · A fluid layout is a layout whose dimensions adapt continuously to available space, commonly using relative rather than fixed measurements.
- grid-template-columnsuses · The CSS grid-template-columns property defines the sizes and optional names of a grid’s column tracks and grid lines.
- grid-template-rowsuses · The CSS grid-template-rows property defines the number, sizes, and track structure of a grid's rows.
- grid containeruses · A grid container is an element whose display mode establishes a CSS Grid formatting context for laying out its child elements as grid items.
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.



