em css question

Associate
Joined
19 Jul 2006
Posts
1,847
What is em and why would you use it instead of px? looked at a few googled sites but can some one put it in laymens terms
 
em means the text size isn't fixed. Basically the user can change the text size when viewing the site (CTRL+mouse scroll or View-Text Size), making it more HCI-friendly.
 
Further to the above, I find the easiest way to use it is to set the body font size at 62.5% which will make 1em = 10px on most browsers (provided the user has left the font on default). This now makes it really easy to figure out proper sizes.
 
Back
Top Bottom