Hot search terms: 360 Security Guard Office365 360 browser WPS Office iQiyi Huawei Cloud Market Tencent Cloud Store
Recently, I encountered a problem when writing a CSS: the line heights of English letters and Chinese characters are different, which leads to deviations in the margin or padding properties set when all Chinese characters, all English letters, and Chinese characters are mixed... Of course, this situation exists in IE browser, and Safari, Google Chrome, Firefox, and Opera do not have similar problems.

css
Cause:
When using all Chinese characters:
Generally speaking, when you select text, you can see that Chinese characters are aligned upward (specifically, when you select a font, it looks like there is an extra part below it from the background. In CSS terms, it means the padding-bottom attribute is generated. To explain the problem, let’s just say that there is a padding attribute).
When using all English letters:
Similar to how all Chinese characters are aligned down when all English characters are written, attributes similar to padding-top will appear. Regardless of whether it is all Chinese characters or all English characters, the line height is the same.
Mixed letters and Chinese characters:
But if you mix Chinese characters and English letters together, you can see the difference. Now select all the fonts and you can see that the padding is padding=padding-top+padding-bottom, which means there will be an extra padding-top (or padding-bottom). Generally, when the font is 12px, the extra part is about 2px.
Solution:
Change font:
Originally I wanted to use line-height to fix it, but line-height is the distance between the baseline of each line, and because the baseline of Chinese characters and English letters are different, it doesn't work. Besides, if it is used as a navigation menu with only one line, it is useless.
The only way to start is with fonts. There is really a font that can solve this problem. This font is "simsun". "simsun" is the long-standing "Songti". The file name of "Songti" in the Windows font folder is "simsun". Its brother "simhei" is commonly known as "Heibody".
Therefore, the solution is to set the font-family to "simsun", which may lose some effects. If anyone has a better solution, please give some advice.
How to add background music in python-How to add background music in python
How to configure environment variables in python - How to configure environment variables in python
How to run python - How to run python
How to create a project in python - How to create a project in python
How to make a blue sky background with scratch-How to make a blue sky background with scratch
Steam
Tencent Video
WPS Office
iQiyi
Sohu video player
Lightning simulator
MuMu emulator
Eggman Party
WPS Office 2023
What to do if there is no sound after reinstalling the computer system - Driver Wizard Tutorial
How to switch accounts in WPS Office 2019-How to switch accounts in WPS Office 2019
How to clear the cache of Google Chrome - How to clear the cache of Google Chrome
How to fire bullets in scratch-How to fire bullets in scratch
How to practice typing with Kingsoft Typing Guide - How to practice typing with Kingsoft Typing Guide