Short answer: Don't do this. Use px
to set font sizes. If you need a bigger font, use a larger number of px
.
Long answer:
The idea behind setting the base font is make it obvious how big a em
s and ex
s are. If your base font size is 10px
, then 1.0em
is 10px
, 1.2em
is 12px
, etc. It seems simple enough. The idea breaks down as soon as a container changes the font size from the base. If you're in a div
with the font size set to 20px
, then all the sudden 1em
is twice as big as it used to be.
It gets worse. People started suggesting that 62.5%
should be used rather than 10px
.
(Note that 16 * 0.625 = 10
). This was suggested because specifying a percentage for font size is a workaround for an issue with old versions of Internet Explorer. The end user couldn't "zoom in" unless you used a percentage.
However, %
(when applied as the default font) is an absolute unit. It may seem like a relative unit, but here, it's a percentage of the user agent's default font size, and font sizes are specified in points. This introduces a subtle and incorrect assumption about the user agent, namely that the screen resolution is 96 dpi. This assumption often results in text which looks like this:
Hey check me out, I'm too small to read!
To sum up:
Don't use hacks for old versions of IE (4 years is plenty of time to maintain backward compatibility; IE7 is four years old this month).
Don't make assumptions about your user agent's resolution, and don't set the body font size to a percentage.
If you need more precise typographical control, use a CSS framework like Baseline.