How many pixels is 1em in IE8?

18,132

Solution 1

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

Solution 2

The unit em is relative.If you have a fontsize of 12pt, 1 em = 12pt. Using a fontsize of 20pt, 1 em = 20pt . It is derived from the letter M. It dates from the time and period when texts were created by a compositor. The letter M was the size of a square of the corpus .

Share:
18,132
frequent
Author by

frequent

Updated on June 23, 2022

Comments

  • frequent
    frequent about 2 years

    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!