Em and px | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Em and px

is there any benefit of using 'em' instead of pixels as size unit

19th Oct 2017, 3:19 PM
Sameer Yadav
Sameer Yadav - avatar
3 Answers
+ 1
Text is always 1em high, so using em is not only easier, but if you use only em in your project you can scale up parts of your page by just increasing the font size, and everything will just work. In my opinion you should be using em for everything except for a couple of special cases (like 1 pixel borders).
19th Oct 2017, 3:34 PM
Schindlabua
Schindlabua - avatar
0
thnx bro
19th Oct 2017, 3:35 PM
Sameer Yadav
Sameer Yadav - avatar
- 1
1em=16px
11th Jun 2018, 7:19 PM
МиКи
МиКи - avatar