Drycodez Posted September 22, 2011 Share Posted September 22, 2011 How does em & percentage% works in font-size? Link to comment Share on other sites More sharing options...
Ingolme Posted September 22, 2011 Share Posted September 22, 2011 It uses a percentage or a proportion relative to the font of the closest ancestor that had a defined size. 1em or 100% means it will be the same size as the text in the parent element.2.2em or 220% means it will be 2.2 times as large as the text in the parent element.0.8em or 80% means it will be 80% the size of the text in the parent element. Link to comment Share on other sites More sharing options...
Drycodez Posted September 22, 2011 Author Share Posted September 22, 2011 If for example the parent element have 10px font-size, that means: 50%, is just a way to say 'take 50% from the parent element,' which ll result to 5px; While 1em, is just a way to say 'take the whole value of the parent element' and 2em is a way to say 'x2 of the value.' am i currect? Link to comment Share on other sites More sharing options...
Ingolme Posted September 22, 2011 Share Posted September 22, 2011 Yes. em is a multiplier for the font size of the parent. Percentage is just like em but divided by 100. Link to comment Share on other sites More sharing options...
Drycodez Posted September 22, 2011 Author Share Posted September 22, 2011 Yes. em is a multiplier for the font size of the parent. Percentage is just like em but divided by 100. Thanks, that was CLEAR! Link to comment Share on other sites More sharing options...
Synook Posted September 23, 2011 Share Posted September 23, 2011 More exactly, one "em" is the width of the character "m" at the current font size. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.