Font Family

Category:CSS Properties

Font Family

The font-family property specifies the font for an element. There are two types of font family names: family-name - The name of a font-family, like times, courier, arial, etc. generic-family - The name of a generic-family, like serif, sans-serif, cursive, fantasy, monospace.

Examples

Multiple Font Families

Setting the font of a <p> element.

p{
  font-family: Arial, Helvetica, sans-serif;
}

Syntax

font-family: value;	

Tips

  • You can specify a list of fonts, from highest priority to lowest. If the browser does not support the first font, it tries the next font.
  • When listing multiple font families, make sure to separate each value with a comma.

Additional Information

For more information, see http://www.w3schools.com/cssref/pr_font_font-family.asp

Found a bug in the documentation? Let us know at documentation@code.org