The 62.5% Trick
In May of 2004, Richard Rutter wrote a seminal piece in web typography in which he outlined a trick that helps make this math easier.
Because typical browsers default their text size to 16px, one can set the font-size value of the body element to 62.5%, effectively resetting the default to 10px.
body { font-size: 62.5% }
This resets the font sizes for the entire site so that 1.0em is the same as 10px.
Simply insert the font-size: 62.5% bit into your body styling and you're done.
Now you can use ems to sizes your fonts rather than pixels.
So your paragraph styles might look something like this:
p { font-size: 1.2em; line-height: 1.5em; }
Simple increments:
0.9em is the same as 9px
1.0em is the same as 10px
1.1em is the same as 11px
1.2em is the same as 12px
etc, etc.
- Other really interesting typographic links:
- .Net magazine article
- That Web blog guy article