When we design web pages, we usually use px to define fonts. This will bring about a problem, that is, we cannot use the browser font amplification function, and we found out when browsing some foreign websites The reason why you can use the browser font amplification function is as follows:
1. IE cannot adjust the font size that uses px as the unit;
2. The reason why most foreign websites can adjust it is that they use Em is used as the font unit;
3. Firefox can adjust px and em, but more than 96% of Chinese netizens use IE browser (or IE-based browser).
px pixel (Pixel), a relative length unit, which is relative to the monitor screen resolution.
em is also a relative length unit, relative to the font size of the text within the current object. If the current font size for inline text has not been manually set, it will be relative to the browser's default font size.
I said that there is no difference between em and px. Px can also be adjusted with the page size. . . . .
Is ie9 updated? Or what?,,,,,,,,,
Doesn’t anyone care about this problem?
Bonus points, this is all my points,
You need to open the menu bar first, select View - Text Size in the menu, and you will see the effect
If you adjust it through "View" - "Zoom", it will change. When you adjust it through "View" - "Font Size", the em will change, but the px will not change.
<!doctype html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Document</title> <style type="text/css"> body{ /*font-size:20px;*//*写成这样就不能通过字体大小来调整了*/ font-size:200%;/*这样写的可以调整*/ } </style> </head> <body> <div style="font-size:32px;"> 中华人民共和国(不会变大小) </div> <div style="font-size:2em;"> 中华人民共和国(可以调整大小) </div> <div style="font-size:1.2em;"> 中华人民共和国(可以调整大小) </div> </body></html>