3.5. Expressing Measurements

Many of the properties you define in a CSS rule include measurements. These measurements tell the rule how tall or wide something is to be. Fonts, spacing, and positioning are the primary places you'll use such measurements.

There are two types of measurements: absolute and relative . An absolute measurement (e.g. setting a font-size to 18px, or 18 pixels) tells the browser to render the affected content as 18 pixels in height[3]. Technically, it actually tells the browser to use the specified font and scale its character height, so that the font's overall height is 18 pixels. Chapter 8, includes an explanation of font height and width.

[3] Again, if I wanted to be terribly precise, I would say that a pixel is ...

Get HTML Utopia: Designing Without Tables Using CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.