liveBook · Manning

Unitless number

A unitless number is a CSS numeric value written without a measurement unit and interpreted according to the receiving property.

How 2 Manning books explain it

CSS in Depth, Second Edition

A unitless number is a CSS numeric value written without a unit and interpreted according to the property that receives it.

How it is used
Uses unitless numbers for property-specific values and adaptable line-height, especially in inherited typography.
How deep it goes
Explains inheritance, local line-height calculation, zero-value limits, and a points-to-pixels conversion, stopping short of broader numeric CSS syntax.
Examples
Demonstrates body line-height, an enlarged paragraph, overlapping unit-based text, and conversion of 18pt leading to 1.5.
What you can do after
Apply unitless line-height and distinguish safe zero values from unsupported angular and time-based uses.

Read how CSS in Depth, Second Edition explains unitless number →

Math for Web Design

A unitless value is a CSS numeric value without a length or other measurement unit whose interpretation depends on the property.

How it is used
Preserves proportional line-height through inheritance and supplies unitless angle inputs to JavaScript trigonometric functions.
How deep it goes
Explains inheritance calculations, responsive formulas, and degree-radian conversion, stopping short of broader CSS numeric-value rules.
Examples
Uses inherited line-height examples, CSS typography calculations, a scaling results table, and JavaScript degree-radian formulas.
What you can do after
Apply unitless line-height for proportional inheritance and convert degree values to JavaScript-compatible radians.

Read how Math for Web Design explains unitless number →

Related concepts

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.