The question is this:
There is a paragraph of text, <p>Who am I? </p>
Then I set different font types to adapt to different clients, but when switching font types, the font size will change.
What should I do if I want to keep the font size unchanged when changing the font type?
I’m not sure what your specific adaptation rules are. Generally, you can write a string of font names in font-family, and the browser will adapt them in order from front to back until it finds the one with the font. Unless you are using web fonts, there is generally no need to use js.
Do you mean that both fonts are 12px, but one is very large and looks like it is more than 12px, and the other is very small and does not look like 12px? If that's the case, I'm also very confused. Some fonts may be large and some small