+ 7
What is 'em' in CSS?
I know pixels, percents, but when we need to use 'em'?
3 RĂ©ponses
+ 11
It is a relative unit of measurement. The size of an em is determined in relation to the size of the font used (it is said that specifically based on the size of the letter M). By default this size is 16 pixels (the size that default browsers assign to typographies).
https://www.w3schools.com/cssref/css_units.asp
https://www.w3.org/Style/Examples/007/units.en.html
+ 5
Mickel, thanks ^^
+ 5
These 4 units come very handy, when doing responsive designing
em - relative to its parent
rem - same as em but relative to root i.e. html
vw - viewport width ( in % of overall screen width)
vh - viewport height ( in % of overall screen height)