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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.