What unit should be used to define the font size of the page in the Web is still hotly debated today. Some people say that PX is a good unit, some say that EM has many advantages, and some are saying that percentage is convenient. There is a PK situation like CSS Font-Size: em vs. px vs. pt vs. percent. Unfortunately, there are still different pros and cons that make each technique less than ideal but still hard not to use. But the emergence of rem seems to make the situation a little better. You can take a look at the differences between rem, em and px. CSS3 REM sets the font size
When I develop, I usually use rem. For individual smaller icons, px is used. If em is used, you need to consider the inheritance of the parent element, which is more commonly used abroad.
What unit should be used to define the font size of the page in the Web is still hotly debated today. Some people say that PX is a good unit, some say that EM has many advantages, and some are saying that percentage is convenient. There is a PK situation like CSS Font-Size: em vs. px vs. pt vs. percent. Unfortunately, there are still different pros and cons that make each technique less than ideal but still hard not to use. But the emergence of rem seems to make the situation a little better. You can take a look at the differences between rem, em and px. CSS3 REM sets the font size