CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise


CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

Font Family in CSS

The font-family Property



The font-family property specifies the font for an element.


Types of a font family are:-


  • font family: a specific font family (like Times New Roman or Arial)
  • generic family: a group of font families with a similar look (like Serif or Monospace)


For your Information:-


The font-family property should hold several font names. When specifying a web font, adding more than one font will avoid unexpected behaviors. If the user's computer for some reason doesn't have the one you choose, it will try the next one.




Its syntax is:-

< style >


font-family: "Times New Roman", Times, serif;


< /style >


Further Explanation:-


Value Description
family-name / generic-family A prioritized list of font family names OR generic family names OR both.
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Code Explanation

All Tutorials related to CSS Basic

All Sections related to CSS