402 Chapter 23 – Cascading Style Sheets
Properties
Web Design in a Nutshell, eMatter Edition
lighter) or as one of the nine numeric values listed above. The default font
weight isnormal, which corresponds to 400 on the numeric scale. Typical
boldtext corresponds to 700 on the numeric scale. There may not be a font
face within a family that corresponds to each of the nine levels of boldness
(some may come in onlynormal andbold weights).
Unfortunately, the current browsers are inconsistent in support of the font-
weight property.
font-size
Values:
absolute size|relative size|length|percentage
Applies to:
All elements
Inherited:
Yes
As the name suggests, thefont-sizeproperty specifies the size of the text
element. There are four methods for specifying font size:
Absolute sizes
Values: xx-small|x-small|small|medium|large|x-large|xx-
large
Example:H1 { font-size: x-large }
Absolute sizes are descriptive terms that reference a table of sizes kept by
the browser.
Relative sizes
Values:larger|smaller
Example:H1 { font-size: larger }
These values specify the size of the type relative to the parent object.
Length sizes
Values:number+em|ex|px|pt|pc|mm|cm|in
Example:H1 { font-size: 24pt }
You can also specify font size using any of the length values described in
the “Length Units” section earlier in this chapter.
Percentage sizes
Values:n%
Example:H1 { font-size: 125% }
This specifies font size as a percentage of the inherited size. For instance,
in this example the H1 will be 125% larger than the size of regular body
text.