CSS Notes (v) fonts

Source: Internet
Author: User

  CSS font Properties Define the font family, size, bold, style (such as italic), and distortion (such as small capital letters) of text.

  Reference: http://www.w3school.com.cn/css/css_font.asp

  

    • CSS Font Series

5 Universal Font Families:

①serif fonts

②sans-serif fonts

③monospace fonts

④cursive fonts

⑤fantasy fonts

    • Specify Word System Class
{font-family: Times , Timesnr, ' New Century schoolbook ', Georgia, ' new York ', serif;}
    • Font style

Often used to specify italic text. A total of three values: Normal,italic and oblique.

{Font-style:normal;}  {font-style:italic;}  {font-style:oblique;}
    • Font warp

Small caps can be set.

{font-variant: normal}  {font-variant: small-caps}

Use:

<class= "normal">This is a test</p>  <class= "small">This is a test</p  >

Effect:

    • Font Bold

Sets the thickness of the text. A 9-level thickness was specified for the font from 100~900. 400 corresponds to normal, while 700 corresponds to bold.

{font-weight:normal;}  {font-weight:bold;}  {font-weight:;}

Use:

<Pclass= "normal">This is a test</P><Pclass= "thick">This is a test</P><Pclass= "Thicker">This is a test</P>

Effect:

    • Font size

Sets the font size of the text. The default normal default size is 16 pixels (16px = 1em). It is likely that you will use EM to set the font size in IE.

{font-size:60px;}  {font-size:2.5em;}  {font-size:0.875em;}

CSS Font Properties
Properties Description
Font Shorthand property. The function is to set all the font-oriented properties in a single declaration.
Font-family Sets the font family.
Font-size Sets the size of the font.
Font-size-adjust Intelligently scales the replacement font when the preferred font is not available. (CSS2.1 has deleted this property.) )
Font-stretch Horizontally stretches the font. (CSS2.1 has deleted this property.) )
Font-style Sets the font style.
Font-variant Displays text in a small uppercase font or in a normal font.
Font-weight Sets the weight of the font.

CSS Notes (v) 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.