Font of CSS Properties (fonts)

Source: Internet
Author: User

Tag: font font-sizeline-height CSS fonts css font

Font of CSS Properties (fonts)



font:[[<font-style> | | <font-variant> | | <font-weight>]? <font-size> [/<line-height>]? <font-family>]

Composite properties, see below for each attribute.

Both Font-size and font-family must be included, and the order of the two values cannot be changed, and the values of the other keywords are placed before the two values, and the order can be arbitrarily scrambled.

You can put an optional row height value (line-height) on the font size value (font-size) as a subordinate value for the font size, followed by a font-family.


Font-style:normal | Italic | Oblique

Normal: Specifies that the text font style is normal.

Italic: Specifies that the text font style is italic. For special fonts that do not have italic design, the oblique will be applied if you want to use italic appearance.

Oblique: Specifies that the text font style is italic. Instead of selecting italic characters in the font, artificially tilt the text.

Note: The difference between italic and oblique can not be seen, at least in the Chrom browser can not see it.


Font-variant:normal | Small-caps

Normal: the proper font.

Small-caps: Small uppercase font.


Font-weight:normal | Bold | Bolder | Lighter | <integer>

Normal: the proper font. Equivalent to number 400.

Bold: Bold. Equivalent to number 700.

Bolder: Extra bold. It is also equivalent to strong and B objects.

Lighter: fine body.

<integer>: Indicates the text font weight with a number. Value Range: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900.


font-size:<absolute-size> | <relative-size> | <length> | <percentage>

<absolute-size>: Adjusts according to the font of the object. Optional parameter value: Xx-small | X-small | Small | Medium | Large | X-large | Xx-large. With medium as the base reference, Xx-small is equivalent to Medium 3/5 (H6), X-SMALL:3/4,SMALL:8/9 (H5), Medium:1 (H4), LARGE:6/5 (H3), X-LARGE:3/2 (H2), X X-LARGE:2/1 (H1).

<relative-size>: Relative adjustment relative to the font size of the parent pair image. Calculated using proportional em units. Optional parameter value: smaller | Larger

<LENGTH>: Specifies the text size with a length value. Negative values are not allowed.

<percentage>: Specifies the text size in percent. The percentage value is based on the size of the font in the parent object. Negative values are not allowed.


font-family:[<family-name> | <generic-family> [, <family-name> | <generic-family>]*

<family-name>: Font name. Ranked in order of precedence. separated by commas. If the font name contains spaces or Chinese, you should enclose it in quotation marks.

<generic-family>: Font sequence name.


font-stretch:ultra-condensed | extra-condensed | Condensed | semi-condensed | normal | semi-expanded | Expanded | extra-expanded | ultra-expanded

Ultra-condensed: 4 cardinality narrower than normal text width.

Extra-condensed: 3 cardinality narrower than normal text width.

Condensed: 2 cardinality narrower than normal text width.

Semi-condensed: 1 cardinality narrower than normal text width.

Normal: Text width.

Semi-expanded: 1 Bases wider than normal text width.

Expanded: 2 bases wider than normal text width.

Extra-expanded: 3 Bases wider than normal text width.

Ultra-expanded: 4 Bases wider than normal text width.


But even with support, the display effect is no different from normal text.


Font of CSS Properties (fonts)

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.