4. Measurements, URLs, and Color Units
In the discussion of CSS syntax in Chapter 1, you saw that the second part of each CSS declaration is a value. In this chapter, you’ll explore some common units for defining sizes (
<percentage>), colors (
<color>), and URLs (
<url>) for defining these values.
Dimensions and other measurements, such as
font-size, are not just raw numbers but a number of some specified of units of measure. CSS has quite a variety of measurement units; the most commonly used are outlined in the following sections.
A pixel unit (
<length>) is a fixed measurement based on the size of a common ...