REM is a new unit introduced by CSS3, relative to PX and em, I feel rem is more convenient, especially for mobile font adaptive layouts .
REM is set based on the font size of the HTML.
The basic font size of HTML is 16px, so you can add the following code:
1{font-size: 62.5%; /*10÷16x100% = 62.5%*/}
This setting means that the HTML font-size is set to 10px for easy calculation.
Then it is possible to use REM as a unit, and it is absolutely feasible to replace PX with REM, such as:
1 #div1{font-size: 1.4rem;}
Because REM is set according to the HTML font size (10px), 1.4rem is 14px.
Note, however, that setting the fixed size directly on the mobile side does not apply ... You can try it if you don't believe it.
However, a percentage can be used, such as:
1 #div1 {font-size: 140%rem;}
Nuu, so you can adapt yourself.
The mobile side uses REM to make the font adaptive