CSS Basics-Fonts

Source: Internet
Author: User

1. font-family: Set Font type

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

    • The user agent iterates through the defined font sequence until it matches a font.
    • body { font-family: helvetica, verdana, sans-serif; }
      • As in the font definition, if you do not have a Helvetica font on your machine, but you have Verdana, you will see your text in Verdana.

2. Color: Font Colors

Color can be specified using color name, HEX, RGB, RGBA, HSL, HSLA, Transparent.

Because different browsers render different color names, it is recommended that you use #hex to represent colors.

3. Font-style: Set font style

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, apply oblique if you want to use italic appearance
Oblique:
Specifies the font that the text font style is italic. Artificially tilt the text instead of selecting italic characters in the font

4, Font-size: Set the font size, generally with px

You can set an absolute size, or you can set a relative size.

5. Font-weight: Set the font weight

Normal: Regular font

Bold: Bold

Bolder: Defines values that are heavier than the inherited value

Lighter: Defines a value that is lighter than the inherited values

General direct use of numbers, 400, 800 and so on.

  

  

CSS Basics-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.