CSS Syntax Manual (i) Font properties

Source: Internet
Author: User
1, font-family

Function: Used to change the font of HTML flags or elements, you can set a list of available fonts. The browser selects the font from front to back.
Syntax: {font-family: Font 1, Font 2, ..., Font n}
Example:


Font

2, Font-style

Function: Make text appear as flat italic or italic, etc. to emphasize.
Numerical:
Normal-OK
Italic-Italic
Oblique-skewed body
Example:


Normal

Italic

Oblique

3, Font-variant

Function: Used to switch between normal and small caps font.
Value: Normal-If the flag inherits the Small-caps setting of the parent element, the keyword normal font-variant is set to the normal font.
Small-caps-lowercase letters are displayed as uppercase letters with smaller font sizes.
Example:


Font-variant

4, Font-weight

Features: Used to set the font grayscale, to generate a deep, shallow version of the font.
Numerical:
Normal grayscale--normal
Relative grayscale-Bold, bolder, light, lighter
Gradient grayscale-values are as follows: 100, 200, 300, 400 (equivalent to normal), 500, 600, 700 (equivalent to bold), 800, 900.
Example:


Font grayscale

5, Font-size

Function: Controls the font size of text in various units of measure.
Value: There are four numerical methods
Absolute size-Define the font size with a specific size table, and you can take one of the following values: Xx-small, X-small, small, medium, large, X-large, Xx-large. Different fonts have different values.
Relative size-larger, smaller, the resulting dimensions are relative to the size of the parent container.
Length-in millimeters (mm), centimeters (cm), inches (in), Points (PT), pixels (px), Pica (PC), ex (height of lowercase letter x) or em (font height) as unit of measure.
Percent-the percentage of the font size relative to its parent element.
Example: Font size


6. Font

Features: Shorthand property, which provides a quick way to set all properties of a font.
Syntax: {font: Font property 1 Font Properties 2 ... Font attribute N}
Value: The Font property value is the previously listed value, in addition to the Line Spacing property line-height (see Text properties), the Order of contents is: Font-style; Font-variant; Font-weight; Font-size; Line-height; Font-family. Partial attributes can be omitted, separated by spaces between attribute values.
Example:

FONT

The above is the CSS Grammar Manual (a) the contents of the font attributes, more relevant content please follow topic.alibabacloud.com (www.php.cn)

  • 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.