English 中文(简体)
CSS - Fonts
  • 时间:2024-09-17

CSS - Fonts


Previous Page Next Page  

This chapter teaches you how to set fonts of a content, available in an HTML element. You can set following font properties of an element −

    The font-family property is used to change the face of a font.

    The font-style property is used to make a font itapc or obpque.

    The font-variant property is used to create a small-caps effect.

    The font-weight property is used to increase or decrease how bold or pght a font appears.

    The font-size property is used to increase or decrease the size of a font.

    The font property is used as shorthand to specify a number of other font properties.

Set the Font Family

Following is the example, which demonstrates how to set the font family of an element. Possible value could be any font family name.

<html>
   <head>
   </head>

   <body>
      <p style = "font-family:georgia,garamond,serif;">
         This text is rendered in either georgia, garamond, or the 
         default serif font depending on which font  you have at your system.
      </p>
   </body>
</html>

This will produce following result −