First: The difference between the Px,em,rem.
PX is an absolute font size
EM is the relative font size calculated based on the cardinality (for example: 1.5em). This cardinality is multiplied by the current object from its parent to the genetic font size.
REM is computed based on the font size of the root node, such as HTML.
First say EM if your default parent container font is 16PX, then 2em=2*16px
<div class= "Parent" style= "font-size:16px" >
<p style= "Font-size:2em" > I am the EM test </p>
</ Div>
rem default font size is determined by the browser or other device you are using in your site's current visit, especially for response design, which has been sought after by mobile design.
<! DOCTYPE html>
See on the Internet
to make the conversion easier, you can set the default font size to 62.5% or 10px to facilitate calculation.
Most browsers (excluding IE8 below) support the font size of REM units
If you want to support, you can, as follows:
HTML {font-size:62.5%;}