Currently, most sites in China use CSS to set the font size to 12 px. Although the pixel is also relative to the size unit, it is only relative to the screen resolution. When the screen resolution is certain, if you feel that the word is too small and difficult to read, you can do nothing in a non-standard browser. Therefore, if you change the unit to em, you can use CTRL + mouse to scroll up the word, you can also use View> text size on the menu to change the word size.
1. in the body tag, set the font size to 62.5%. If no CSS is set in the body, the default size of the browser is 16px with 62.5%, the font size is 16px * 62.5% = 10px. You can use em to set the size easily. For example, if you need 12px, you only need to set 1.2em.
The code is as follows: |
Copy code |
Body { Font-size: 62.5%; } H1 { Fong-size: 1.4em;/* the size of h1 is equal to 14px */ } 2. If the font size in the body is set to 75%, the font size is 16px * 75% = 12px, and 1em is equivalent to 12px. Body { Font-size: 75%; } H1 { Fong-size: 1.5em;/* the size of h1 is equivalent to 18px */ }
|
The first method is better. For an English website, you can also set it to small, x-small... of course, this will require a higher page design.