When used to specify font sizes,the
em unit refers to the font size of the
parent element. So,in the prevIoUs
example,the font size of the H1
element is set to be twice the font
size of the BODY element. To find what
the font size of the H1 element will
be,we need to know the font size of
BODY. Because this isn’t specified in
the style sheet,the browser must find
it from somewhere else – a good place
to look is in the user’s preferences.
So,if the user sets the normal font
size to 10 points,the size of the H1
element is 20 points. This makes
document headlines stand out relative
to the surrounding text. Therefore:
Always use ems to set font sizes!