Before this, has been firmly used in the PX as a measure of the length of all, until today to get the "CSS disclosure", feel the discovery of the new world, a lot of the introduction of EM, a little dazzled, had to read the notes of the great God ....
EM as a relative amount of units, 1 of the vertical space required for letters in any font, EM can also be understood as a percentage unit, the value of em = The pixel value that needs to be converted The font-size of itself or of the parent element (the font-size of the parent element is taken when the element itself is set font-size font-size)
Here's an example to compare EM and px
<! DOCTYPE html>
When we zoom in and out of the page by CTRL + the scroll wheel, the "overflow phenomenon" occurs because we are using absolute values.
These are the absolute values defined by the previous PX, and then we use EM to transform
<! DOCTYPE html>
Convert the previous 400px by 400/16 (Font-size of the current element) to EM as follows
Press CTRL + SCROLL wheel to zoom
Compare the PX and EM scaling to find that the ' overflow ' phenomenon in PX does not occur with EM
For more technical details please refer to Http://www.w3cplus.com/css/px-to-em, summary of the Great God
Funny em.