Summarize Long introduction of a large pile, the only thing to tell you is the following points 1, the browser's default font size is 16px 2, if the element itself does not set the font size, then all the property values on the element itself such as "boder, width, height, padding, margin, line-height" equivalent, we can be calculated according to the following formula 1÷ the Font-sizex of the parent element needs to convert the pixel value = em value 3, this one must slowly understand, otherwise it is easy to mix with the 2nd. If the element sets the font size, the conversion of the font size is still calculated as the second formula, which is the following: 1÷ the Font-sizex of the parent element needs to convert the pixel value = em value Then the element sets the font size, and other properties of this element, such as "border, width, height, padding, margin, line-height", are calculated according to the following formula: The Font-sizex of the 1÷ element itself needs to convert the pixel value = em value In this way, I do not know that you understand the whole understanding of no, if not the whole understanding, you can go back to see an example above. |