How many pixels is 1em in IE8?

frequent picture frequent · Mar 3, 2012 · Viewed 18.1k times · Source

Isn't 1em supposed to be 16px across all browsers?

I have this CSS

* {font-size: 1em; }
label { font-size: .85em; }

which on IE8 strangly gives label elements a height of 12px vs. the 13.6px I was hoping for.

Thanks for help!

Answer

Kian picture Kian · Mar 3, 2012

Isn't 1em supposed to be 16px across all browsers?

Not necessarily:

One 'Em'(1em) is equal to the height of the capital letter "M" in the default font size. When applied in CSS, the Em represents either the user's default font size, or the size of the parent element's font size, if one is available.

So while the default font size is 16px, perhaps you have a different size set on IE.

Also you may have some obscure parent element that is overriding it.

More info