Description: This CSS tutorial describes how to use the font-size property to control the size of text.

Tutorial created using:
Windows XP

The size of text can be controlled using the font-size property. The CSSW 2.1 specification states that the value for this property can be: absolute size, relative size, length, percentage, or inherit. Possible absolute sizes are: xx-small, x-small, small, medium, large, x-large, and xx-large. Possible relative sizes are: larger, smaller. In addition, size can be specified in terms of lengths. Lengths can be specified in a variety of units, such as relative units like em (font-size of relevant font), ex (x-height of relevant font), and px (pixels), and absolute units such as in (inches), cm (centimeters), mm (millimeters), pt (points - 1/72 of an inch), and pc (picas - 1 pica = 12 points). Percentages can also be used to specify the size relative to the parent element's font size.

The style-test.html file below demonstrates several different font-size values.