Rem
The rem is a CSS relative length unit whose value equals the computed font size of the document’s root element.
Build a Website with ChatGPT
The rem unit is a CSS relative length unit measured against the root element's font size.
- How it is used
- Offers rem as an accessibility-minded alternative to px values when customizing page typography and spacing.
- How deep it goes
- Defines relative sizing and supplies default px conversions, but does not explain root-font configuration or rendering internals.
- Examples
- Converts a 20px entry-text font size to 1.25rem and lists equivalents for 24px, 32px, and 48px.
- What you can do after
- Operate/configure CSS by replacing px measurements with equivalent rem values for font sizes and spacing.
CSS in Depth, Second Edition
The CSS rem unit is a relative length unit whose value is based on the computed font size of the root element.
- How it is used
- Uses rem for predictable font sizes and measurements that should follow the root rather than a component’s font size.
- How deep it goes
- Defines the root-relative calculation and works through nested lists and component resizing, without prescribing rem for every length.
- Examples
- Shows a nested list, a relatively sized panel, and navigation padding changed from em to rem.
- What you can do after
- Operate/configure it by setting the root font size for page-wide scaling and selecting rem or em for the desired component behavior.
Web Design Playground, Second Edition
The CSS relative length unit whose value is based on the computed font size of the document's root element.
- How it is used
- Uses rem to keep typography and selected layout measurements responsive to the visitor’s default font size.
- How deep it goes
- Defines rem against the html root and works through font-size and header-height changes; leaves broader responsive-layout choices to separate guidance.
- Examples
- Shows a 1.5rem paragraph at two browser defaults, rem-sized headings across a media query, and a header changed from 64px to 4rem.
- What you can do after
- Practice/perform it by replacing fixed pixel font sizes and suitable vertical measurements with rem values.
Read how Web Design Playground, Second Edition explains rem →
Tiny CSS Projects
The CSS rem unit expresses a length relative to the font size of the document's root element.
- How it is used
- Sizes headings and form inputs relative to the root font size across several page designs.
- How deep it goes
- Defines rem, contrasts it with em, and calculates sizes from a 16px default; stops short of browser internals.
- Examples
- Shows a 4rem newspaper headline, a 2rem profile name, and 1rem form inputs.
- What you can do after
- Apply it via CSS to size headings and inputs relative to the root font size.
Math for Web Design
The rem unit is a CSS relative length unit equal to the computed font size of the root element.
- How it is used
- Uses rem to establish predictable font sizes, spacing scales, and responsive typography tied to the root element.
- How deep it goes
- Explains pixel conversion, inheritance contrast with em, and clamp-based scaling, but stops short of browser rendering internals.
- Examples
- Demonstrates equivalent unit declarations, nested headings, and constrained hero text scaling across phone and laptop widths.
- What you can do after
- Apply rem to prevent inherited font-size compounding and build bounded fluid typography with clamp().
Web Design Playground
A CSS font-relative length unit equal to the font size of the root element.
- How it is used
- Sizes typography relative to the root so changes to a visitor’s default font size can affect the result.
- How deep it goes
- Defines rem against the root font size, calculates rendered sizes, and contrasts inherited em sizing.
- Examples
- Calculates 1.5rem at two default font sizes and replaces pixel-based font sizes on an example page.
- What you can do after
- Apply it via CSS font-size declarations, replacing fixed pixel sizes and checking the result after changing browser defaults.
Architecting Accessibility
A rem unit is a relative CSS length unit whose value is based on the root element's font size.
- How it is used
- Uses rem to size readable text while supporting users’ font-size preferences.
- How deep it goes
- Defines rem relative to the root font size, explains scaling, and contrasts fixed-pixel sizing with CSS examples.
- Examples
- Shows root sizing at 100%, body text at 1rem, an h1 at 2rem, and fixed-pixel alternatives.
- What you can do after
- Apply rem sizing in CSS to support user font preferences and proportional text scaling.
Also covered in
What to know first
- CSSCSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- pixelA pixel is either a discrete image sample carrying visual information at a raster location or, in CSS, an abstract reference unit for rendered dimensions.
- viewportA viewport is the visible region of a browser or graphical interface in which a document or other content is displayed.
- paddingPadding is the provision of extra values, characters, bytes, or space around or within data or an element to meet length, boundary, block-size, spacing, or alignment requirements.
Related concepts
- font-size propertyuses · The CSS font-size property specifies the size at which an element’s text is rendered.
- relative valuekind of · A relative value expresses a quantity in relation to a contextual reference quantity rather than as an absolute value.
- emcontrasts with · The em is a CSS relative length unit whose computed value is based on the applicable font size.
- root elementuses · A root element is the topmost element in a document or element tree, from which all other elements descend.
- absolute unitcontrasts with · 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.
- pixelalternative to · A pixel is either a discrete image sample carrying visual information at a raster location or, in CSS, an abstract reference unit for rendered dimensions.
Questions about rem
What is rem?
The rem is a CSS relative length unit whose value equals the computed font size of the document’s root element.
Which Manning books explain rem?
Build a Website with ChatGPT, CSS in Depth, Second Edition, Web Design Playground, Second Edition, Tiny CSS Projects, Math for Web Design, Web Design Playground and Architecting Accessibility.
What should I know before learning rem?
Manning books that teach rem usually introduce CSS, pixel, viewport and padding first.
What is the difference between rem and em?
The rem is a CSS relative length unit whose value equals the computed font size of the document’s root element. The em is a CSS relative length unit whose computed value is based on the applicable font size.
What is rem a kind of?
Rem is a kind of relative value. A relative value expresses a quantity in relation to a contextual reference quantity rather than as an absolute value.
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.






