CSS Font

1
Product Spotlight

description

cf

Transcript of CSS Font

  • 1/10/14 CSS Font

    file:///E:/Document/W3School/W3schools Offline Version/www.w3schools.com/css/css_font.asp 3/4

    Example

    body {font-size:100%;}h1 {font-size:2.5em;}h2 {font-size:1.875em;}p {font-size:0.875em;}

    Try it yourself

    Our code now works great! It shows the same text size in all browsers, and allows all browsers tozoom or resize the text!

    More Examples

    Set the boldness of the fontThis example demonstrates how to set the boldness of a font.

    Set the variant of the fontThis example demonstrates how to set the variant of a font.

    All the font properties in one declarationThis example demonstrates how to use the shorthand property for setting all of the font propertiesin one declaration.

    All CSS Font Properties

    The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 orCSS2).

    Property Description Values CSS

    font Sets all the font properties in onedeclaration

    font-stylefont-variantfont-weightfont-size/line-heightfont-familycaptioniconmenumessage-boxsmall-captionstatus-barinherit

    1

    font-family Specifies the font family for text family-namegeneric-familyinherit

    1

    font-size Specifies the font size of text xx-smallx-smallsmallmediumlargex-largexx-largesmallerlargerlength%inherit

    1

    font-style Specifies the font style for text normalitalicobliqueinherit

    1

    font-variant Specifies whether or not a text should bedisplayed in a small-caps font

    normalsmall-capsinherit

    1

    font-weight Specifies the weight of a font normalboldbolderlighter100200300400500600700800900inherit

    1

    Previous Next Chapter

    Product Spotlight