Solutions to garbled css fonts: 1. Unify css coding and html page coding; 2. Write Chinese fonts in English, such as "font-family:"simsun";".
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.
Css Chinese font garbled solution:
Unify css encoding and html page encoding. If the html page is utf-8, css, and js are also unified into utf-8 encoding. If the html page is gb2312, css, and js are also unified into gb2312 encoding.
Another way to avoid Chinese garbled characters is to write Chinese fonts in English, for example: font-family: "宋体"; font-family: "Microsoft Yahei"; corresponding to: font-family:" simsun";font-family:"Microsoft YaHei";
[Recommended learning: css video tutorial]
The above is the detailed content of What to do if css font is garbled. For more information, please follow other related articles on the PHP Chinese website!