1em doesn’t actually = 10px. Here’s a good bit of CSS that makes font sizes behave consistently and also cleans some stuff up in general:
/* Neutralize styling:
Elements we want to clean out entirely
and we reset the base font-size to 10px:
---------------------------------------------------------------- */
html, body, form, fieldset {
margin: 0;
padding: 0;
font-size: 100%;
line-height: 1.5;
font-family: Arial, Helvetica, sans-serif;
}
html {
font-size: 100.01%; /* avoids obscure font-size bug */
height: 100%;
margin-bottom: 1px; /* avoid jumping scrollbars */
}
body {
font-size: 62.5%; /* 10px ... 68.75%=11px 75%=12px 81.25%=13px 87.5%=14px*/
height: 100%;
text-align: center;
}
img {
border: 0;
}
/* Neutralize styling:
Elements with a vertical margin:
---------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6, p, pre, blockquote, ul, ol, dl, address {
margin: 0 0 1em;
padding: 0;
}
/* Apply left margin:
Only to the few elements that need it:
---------------------------------------------------------------- */
li, dd, blockquote {
margin-left: 1em;
}
/* Miscellaneous conveniences:
---------------------------------------------------------------- */
form label {
cursor: pointer;
}
fieldset {
border: none;
}
input, select, textarea, td {
font-size: 100%;
}
.clearfix, .cls { /* use with a <br class="cls" /> to clear floats with no extra space*/
clear: both;
height: 0;
margin: 0;
font-size: 1px;
line-height: 0;
}
.clear { clear: both; }
/* Headers and Paragraphs:
---------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
h1 { font-size: 218%; }
h2 { font-size: 164%; }
h3 { font-size: 145%; }
h4 { font-size: 118%; }
h5 { font-size: 100%; font-weight: bold; }
h6 { font-size: 86%; font-weight: bold; }
p { color: #222; }
p.caption { font-size: 86%; color: #555; }
The reason to set the base font size to 10px via the method above is that it allows for really easy math when you want, say, a 24px tall header:
font-size: 240% or font-size: 2.4em
Hope this helps.