Absolute Versus Relative Sizes
Before diving into the details of specifying type size, it
is worth pausing to clarify the difference between absolute and relative
sizes. Absolute sizes have predefined meanings or
an understood real-world equivalent. In CSS, absolute values may be
expressed as keywords, such as small
or x-large (discussed next) or by
using absolute length values, such as cm (centimeter), in (inch), or pt (point, 1/72 of an inch).
Relative sizes, on the other hand, are based on the size of something else, like the parent element or the em measurement of the text (see the sidebar "A Word About Ems“). Relative values, such as em and percentages, are generally preferred for web text for reasons that are covered in the upcoming sections.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access