HTML and CSS Reference
xx-small | x-small | small | medium | large | x-large | xx-large | smaller | larger |
<length> | <percentage>
Calculated with respect to the parent element's font size
An absolute length
Defines the size of the font. The size can be defined as an absolute size, a relative size, a length
value, or a percentage value. Negative length and percentage values are not permitted. The
dangers of font-size assignment are many and varied, and points are particularly discouraged
in web design, as there is no certain relationship between points and the pixels on a monitor.
It's a matter of historical interest that because of early misunderstandings, setting the font-
size to medium led to different results in early versions of Internet Explorer and Navigator
authors are encouraged to use either percentages or em units for font sizing. As a last resort,
pixel sizes can be used, but this approach has serious accessibility penalties because it pre-
vents users from resizing text in IE/Win, even when it is too small to read comfortably. Most
other browsers allow users to resize text regardless of how it has been sized.