Home  >  Article  >  Web Front-end  >  Two CSS font properties you must know

Two CSS font properties you must know

php中世界最好的语言
php中世界最好的语言Original
2018-03-13 10:14:091885browse

This time I bring you two CSS fontproperties that you must know. What are the precautions for using CSS font properties? Here are Let’s take a look at practical cases.

How to set different fonts for English and Chinese?

Every Chinese font contains English,
But any English font does not Including Chinese,
means that Chinese fonts can handle English, but English fonts cannot handle Chinese.

Note: If you want to set a separate font for English in the interface, then the English font must be written in Chinese The previous

supplements that the most common fonts used in enterprise development are the following

Chinese: Songti/HeiTi/Microsoft Yahei
English: "Times New Roman"/Arial

One more thing you need to know is that if the name is in English, it does not necessarily mean it is an English font

Because Chinese fonts actually have their own English names, so whether it is a Chinese font mainly depends on whether it can handle Chinese
Song Dynasty SimSun
黑体SimHei
Microsoft YaHeiMicrosoft YaHei

font-family:"Times New Roman","微软雅黑";
// Times New Roman:为英文字体  备选方案:"微软雅黑"为中文字体
//由于"Times New Roman"字体不能处理中文字体,故调用备选方案"微软雅黑"去处理中文

Abbreviation of text attribute

Abbreviation format:
font: style weight size family ;
For example:
font:italic bold 10px "楷体";

Notes:

1. Some attribute values ​​in this abbreviation format can be omitted
Sytle can be omitted
Weight can be omitted

2. In this abbreviation format, the positions of style and weight can be exchanged

3. In this abbreviation format, some attribute values ​​are not What can be omitted
size cannot be omitted
family cannot be omitted

4. The positions of size and family cannot be randomly placed
size must be written in front of family, and size and family It must be written at the end of all attributes

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to the php Chinese website Other related articles!

Recommended reading:

How to load HTMLString in iOS webView

html5 little knowledge that is easily overlooked

The above is the detailed content of Two CSS font properties you must know. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn