Discussion on several common CSS font setting problems

Source: Internet
Author: User

CSS font settings in the use of the process occurs frequently, the following for everyone to organize a number of related solutions, interested friends can refer to the following

font:12px/1.5 Arial,5b8b4f53,sans-serif What do you mean





font: Font size/font row high font format





the use of Chinese fonts in CSS usually directly sets the font name, such as setting the font to the Arial: font-family: ' Song Body '. But the problem is that if the CSS is incorrectly encoded, it will cause the Chinese font garbled in the CSS after the page is loaded





use Chinese fonts directly, sometimes the problem of style loss occurs under IE6.





and use English instead of Chinese such as: "Font-family:simsun" is not recommended, some version of Firefox and opera in the processing of SimSun will have problems.





It is recommended to use Unicode encoding for Chinese fonts. Then how to solve this garbled problem, because CSS files are basically UTF-8 encoding mode, so we can use the name of the Chinese font with the corresponding Unicode code to replace, so you can effectively avoid the browser to explain the CSS code when the problem of garbled. For example, the Chinese font "XXFarEastFont-Arial" after the Unicode encoding for "5b8b4f53″, in the CSS can be written: font-family: ' 5b8b4f53 ';" If in your "div+css" process, still need to use some of the table fonts, you can use Firefox plug-in firebug to query the required Chinese font corresponding to the Unicode encoding, the method is very simple, that is, open Firefox, and then open the Firebug, in the " Console ">>>" in the back of the bottom like this input





Escape (' black body ');





Escape (' black body ');





Escape (' black body ');





Escape (' black body ');





Escape (' black body ');





Escape (' Microsoft Ya-Black '), and then will display a message,%u5fae%u8f6f%u96c5%u9ed1 This is the Chinese font "Microsoft Ya Black" corresponding to the Unicode code "5fae8f6f96c59ed1", note that the%u changed, Otherwise, there may be an error.


http://my.csdn.net/uploads/201208/02/1343889041_2779.jpg


use Firebug to query the Unicode encoding of Chinese fonts (Firefox 14.0.1,firebug 1.10.1)





In addition, it is best to write the English font in front when setting the font, otherwise, all the English fonts and numbers in the Web page will be turned into "XXFarEastFont-Arial" or other fonts, which looks rather unattractive. For example: font-family: ' 5fae8f6f96c59ed1 ', Arial; it's best to write like this: font-family: ' 5fae8f6f96c5 9ed1 ', Arial;





for the convenience of friends in need of quick use, the following table lists some common Chinese fonts for Unicode encoding:


SimSun 5b8b4f53


blackbody Simhei 9ed14f53


Microsoft Yahei 5fae8f6f96c59ed1


Microsoft is in boldface Microsoft Jhenghei 5faex8f6f6b639ed14f53


Xin Song body Nsimsun 65b05b8b4f53

PMingLiU 65b07ec6660e4f53
of
new fine body
MingLiU 7ec6660e4f53

fine-ming body

standard italics DFKAI-SB 680769774f53


Imitation Fangsong 4eff5b8b


italics Kaiti 69774f53


Imitation _gb2312 fangsong_gb2312 4eff5b8b_gb2312


italics _gb2312 kaiti_gb2312 69774f53_gb2312


Chinese fine black stheiti Light [Stxihei] 534e65877ec69ed1


XXFarEastFont-Arial Stheiti 534e65879ed14f53


Chinese italics Stkaiti 534e658769774f53


XXFarEastFont-Arial Stsong 534e65875b8b4f53


Chinese imitation stfangsong 534e65874eff5b8b


Pro Lihei Pro Medium 4e3d9ed1 Pro


-Song Pro Lisong Pro Light 4e3d5b8b Pro


standard italics Biaukai 680769774f53


Apple ligothic Medium 82f9679c4e3d4e2d9ed1


Apple Lisung Light 82f9679c4e3d7ec65b8b





 


Google font contrast: http://hotoo.googlecode.com/svn/trunk/labs/css/css-fonts.html

Related Article

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.