+ 2
Em or px for sizing in CSS.
Which should I choose? I have always used px and I am now learning Em is a thing. Is relative always better?
3 ответов
+ 9
“Ems” (em): The “em” is a scalable unit that is used in web document media. An em is equal to the current font-size, for instance, if the font-size of the document is 12pt, 1em is equal to 12pt. ... Pixels (px): Pixels are fixed-size units that are used in screen media (i.e. to be read on the computer screen).
https://kyleschaeffer.com/development/css-font-size-em-vs-px-vs-pt-vs/
https://stackoverflow.com/questions/609517/why-em-instead-of-px
+ 3
thanks scooby
0
I have always been told that ems were beter in general fue to their scalable nature which allowed your site to be displayed correctly on different size screens without breaking