React develops mobile rem adaptation solution solution

Insert picture description here

Create a function to take out the width of the visible desktop. When the width is less than 350, the fontSize value is no longer reduced. When the width is greater than 750, the fontSize value is no longer increased. In the middle, the fontSize value is changed according to the width change, and then When the page is resized, it is called when the width changes, and it is called the first time.

Guess you like

Origin blog.csdn.net/lin_fightin/article/details/113571490