Is 1.0em the same as 100% for font sizes?

I am trying to debug why font-size: 1.0em in jquery-ui makes my font sizes for my page huge (over 16 pixels), without any actual font size changes. Well, in Firebug I saw a strange thing for an accordion.

At the bottom was font-size: 1.0em , but later it was canceled by font-size: 100% . Could this cause some kind of problem with the font size? It always seemed to me that 100% matches 1.0em

+7
css font-size
source share
3 answers

Yes.

1em and 100% mean the same thing (for font-size) - "The same font size as the parent element" (this is not the same as the font size that the user selected when talking about the HTML element).

Internet Explorer has errors if em used, and the font size selected from the browse menu is not medium .

+6
source share

Yes, em and percentage are interchangeable in terms of font size.

I canโ€™t say what happens in your case without code, but it may have something to do with the size of the embedded fonts:

 <div style="font-size: 150%;"> This text is at 150% of the base. <div style="font-size: 100%"> This text is the same size as the text above. </div> </div> 
+3
source share

em defined for each user in the browser. Thus, em is defined for access in different browser settings or user preferences.

This means that 1em can be 16px or 10px according to the user's preference setting in the browser.

If you want more control over the font size, use px instead of em .

0
source share

All Articles