VOOZH about

URL: https://www.geeksforgeeks.org/css/how-to-set-the-font-family-of-text-using-css/

⇱ How to set the font family of text using CSS ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to set the font family of text using CSS ?

Last Updated : 23 Dec, 2020

The CSS font property is used to set the fonts content of HTML element. The font-family property specifies the font of an element. It can have multiple fonts as a backup system i.e. if the browser doesn’t support one font then the other can be used.

Syntax:

element_selector {
 font-family: fonts-name | initial | inherit;
}

Property values:

  • fonts-name: The names of the font in quotes separated by commas.
  • initial: It sets the property to its default value.
  • inherit: It inherits the property from the parent element.

Example:

Output:

👁 Image
Comment
Article Tags: