Fraction unit
The CSS fr unit represents a share of the free space remaining in a grid container after non-flexible track sizes and other deductions are accounted for.
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.
Read how CSS in Depth, Second Edition explains fraction 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.
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 fraction unit →
Related concepts
- mathematical expressionuses · A mathematical expression is a syntactically structured combination of values, variables, operators, functions, and grouping symbols that denotes a value or computation.
- 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 web layout whose dimensions adapt continuously to changes in available viewport space.
- 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.
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.



