Why do some websites set rem? according to the font-size of fixed html

Why do some websites set rem, by fixing the font-size value of html through css? isn"t setting rem the same as setting px directly?

Qunar: http://touch.piao.qunar.com/

Mar.28,2021

Direct px can also adapt, but it's much easier to use rem (sorry, I thought I first saw the rem written in rem,)


to solve the problem of mobile adaptation


to ensure that the same ui


you are right, the fixed one is the same as px. Maybe people will manually change ~


to set the font-size of html. You don't have to use js,. You can use css's media query to set the font-size, of html under different screens. Obviously, you say that yours belongs to the font-size of html under different screens.


because in order to facilitate calculation, 50px or 100px, depending on the size of the original design draft, you can refer to my article to understand. rem adapts to mobile devices

Menu