CSS sets different fonts for English and Chinese fonts, respectively

Source: Internet
Author: User

Font-family Method of Invocation:

div {    font-family:Arial,‘Times New Roman‘,‘Microsoft YaHei‘,SimHei;       font:bold12px/0.75em Arial,‘Times New Roman‘,‘Microsoft YaHei‘,SimHei;  }

According to the principle of font-family, if the client terminal does not know the front font, it will automatically switch to the second font, the second one does not know to switch to a third, and so on. Call the default font if none is recognized

Based on the font-family font invocation principle we can call different fonts for English, Chinese, etc. two fonts to render.

such as: Arial, ' times New Roman ' These two fonts do not know Chinese, only know English, so, these two fonts can only render English numerals and some special symbols, and the Chinese on the page will automatically call the third font Microsoft Yahei (PS: If this font exists ).

So, in the definition of the font when the English font written in front of the Chinese written in the back. In this way, the system will automatically sequentially give the word font, if the current font does not support text, automatically swap the next font in the list

After testing, IE9, IE9 compatibility mode (compatible with IE8), the latest version of Chrome (34.0), the latest version of the Firefox browser (29.0) support the font-family attribute;
However, some versions of IE (IE7, IE8) cannot fulfill the requirements of the Font-family property, and some strange bugs are exposed. If you use Chinese fonts (such as Microsoft Black) in these versions of the browser, you need to place the Chinese font at the top of the Font-family property, but it will cause the English font to be rendered using the Chinese font as well. It is not supported in these browsers (IE7, IE8) to use different fonts for English and Chinese fonts in the font-family attribute.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.