+ 1

The best measurement unit?

What is the best measurement unit that should be used in general. Like, px, %, em, vw, etc.

17th Sep 2016, 4:38 AM
Surya Deep Mishra
Surya Deep Mishra - avatar
2 Answers
+ 2
This is obviously a subjective question, but in general, it is best to use relative measurements for values that can change their length. For example, if a user with bad eyes uses a larger font in their browser settings, em and % will change the font to reflect the non-default settings. px and other absolute measurements will not. Absolute measurements should be used only when the physical output is known to be constant. If you are making a page that you expect to be printed onto a special size paper for instance. I can't really think of any other reasons off the top of my head. 9/10 times you will use em or %. So even though they are more difficult to understand, you should put time into learning them.
17th Sep 2016, 4:53 AM
Ryne - avatar
Thanks for ur help Ryne. Even i use the 'em' unit most of the times.
17th Sep 2016, 4:59 AM
Surya Deep Mishra
Surya Deep Mishra - avatar