views:

54

answers:

1

Possible Duplicate:
Why em instead of px?

em

or

px

or

%

I always found px to be better, but why do people use em?

+2  A: 

px is good, if you design for a single browser, screen dimensions, fonts, etc. This way you explicitly set the size of the elements of the page, and no exceptions are possible.

If your site is getting viewed in various platforms/browsers, where screen size varies, some fonts are unavailable, the user changes the browser font size, etc., then it becomes a good idea to use abstract measurements, such as em or %, because using them the system tries to automatically calculate sizes, thus making it harder for text to be truncated.

Zoltán Ujhelyi