Introduction to the example of setting font-family in CSS

Source: Internet
Author: User
font-family version: CSS1 compatibility: ie4+ ns4+ Inheritance: Available

Grammar:

Font-family:name font-family:cursive | Fantasy | monospace | Serif | Sans-serif


Parameters:

Name: Font names. Ranked in order of precedence. separated by commas. If the font name contains spaces, enclose it in quotation marks
The second way of declaring is to use the list of font sequence names. If you use the fantasy sequence, the default font sequence is provided

Description

Sets or retrieves a sequence of font names used for text in an object.
The default value is determined by the browser.
The sequence can contain embedded font fonts. See @font-face rules.
The corresponding script attribute is fontfamily. Please refer to the other bibliography I have written.
Example:

div.fixedwidth {font-family:courier, "Courier New", monospace}

Why is the font-family set in CSS: "Microsoft Black" is useless?

Recommended use of font-family: "Microsoft Yahei";
Supports the UTF-8 and GB2312 character sets.
3 cases not in force:
1. When this attribute defines a global style, the label for the form class does not take effect and needs to be defined again as:
Body {font-family: "Microsoft Yahei";} The form input does not take effect,
You also need to define an input {font-family: "Microsoft Yahei";} Can.

2. The local computer does not exist Microsoft Ya Black font, some system default does not have Microsoft ya Black, the general default is the song body, as long as the download a Microsoft Ya black font, after installation can.

3. There is also a character set problem, it is suggested that the Chinese font-family: "Microsoft Jas Black"; font-family: "Microsoft Yahei"; The character set affirms UTF-8 or GB2312.

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.