The difference of PX, EM and REM in CSS unit

PX PX pixels are relative to the screen resolution of the display. Fonts, buttons, etc. that use it as units cannot be resized when the browser zooms the page. The value of EM is not fixed. It inherits the font size of the parent element, representing a multiple. If the font size is not currently set by its parent, it is relative to the default font size of the browser. The value of rem is not fixed and is always based on the root element < HTML > and also represents a multiple. The use of EM is relative to the font size of its parent, i.e. multiple. The default font size for browsers is 16px
All rights reserved

User login

Share to: