Relative Font Sizes
Earlier, we discussed
font size keywords
which are relative to the font size of BODY root element.
CSS provides three more ways to size text relatively using
These three methods work like keywords—they specify text size in proportion to the parent element—but they offer much finer granularity over the computed result.
Examples of Relative Font Size Declarations
p { font-size: 80%; }
p { font-size: 0.8em; }
p { font-size: 120%; }
p { font-size: 1.2em; }
p { font-size: 14px; }
Note in the examples above the first two rules are equivalent; as are the second two rules.
Let's begin our discussion of relative font sizes by exploring pixels.