liveBook · Manning

Relative value

Also called relative measurements

A relative value expresses a quantity in relation to a contextual reference quantity rather than as an absolute value.

How 2 Manning books explain it

CSS in Depth, Second Edition

A relative CSS unit specifies a size in relation to a font size, viewport dimension, or another reference size rather than as a fixed absolute measure.

How it is used
Supports responsive sizing by letting typography and component dimensions change with font-size or viewport references.
How deep it goes
Explains em and rem references through computed values and worked CSS, then applies them to responsive sizing and spacing choices.
Examples
Uses boxes with em-based padding and radius, a responsive panel, and navigation spacing converted from pixels.
What you can do after
Practice/perform unit selection to scale components with text, adjust page-wide sizing, and keep selected gaps in pixels.

Read how CSS in Depth, Second Edition explains relative value →

Web Design Playground, Second Edition

A relative CSS unit represents a dimension calculated from another size, such as an inherited, parent, root, or user-defined size.

How it is used
Uses relative units to preserve user-chosen text sizing and build layouts that adapt across screen sizes.
How deep it goes
Explains unit reference points, inheritance effects, responsive guidelines, and a worked px-to-rem header revision.
Examples
Demonstrates user-scaled typography, nested em sizing, a responsive header, and rem-percentage page spacing.
What you can do after
Apply relative CSS units to create responsive spacing, sizing, and typography that respond to user settings and viewport dimensions.

Read how Web Design Playground, Second Edition explains relative value →

Also covered in

What to know first

Related concepts

Questions about relative value

What is relative value?

A relative value expresses a quantity in relation to a contextual reference quantity rather than as an absolute value.

Which Manning books explain relative value?

CSS in Depth, Second Edition and Web Design Playground, Second Edition.

What should I know before learning relative value?

Manning books that teach relative value usually introduce pixel, CSS, viewport and em first.

What is the difference between relative value and absolute unit?

A relative value expresses a quantity in relation to a contextual reference quantity rather than as an absolute value. An absolute CSS length unit has a fixed reference magnitude or defined relationship to physical or CSS reference lengths rather than depending on surrounding layout.

What kinds of relative value are there?

Kinds of relative value include em and rem.

What is relative value also called?

Relative value is also called relative measurements.

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.