By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

CSS Font-family Property

Reference on the CSS font-family Property. Including background information and Example of use.

Edited: 2015-02-21 15:06

The font-family property is used to set the font family to be used on a page. It can both be used to set specific fonts, by using their exact name in quotes, or to set a family of fonts.

The first font found to be installed on a users system, will be the chosen one.

If font-family is used inside of the font-face rule, it will instead represent the remote font-name.

Possible Values

There are countless of fonts you can use, however they would need to be installed on your visitors system, before they would be able to view them. The generic font families are:

  • serif
  • sans-serif
  • cursive
  • fantasy
  • monospace

The font-family is a list of fonts, separated by comma; browsers will use the first font which is installed on the system. In addition, names containing whitespace should be quoted; and Font names should also be capitalized. I.E. "Times New Roman".

Font-family example

body {
  font-family: "Comic Sans MS", Arial, "Times New Roman", serif, sans-serif;

Inherited? - YES!