CSS font-family property
Description
CSS font-family property defines the types of font faces that vary in size and shapes.
There are only five generic families such as serif, sans-serif, cursive, fantasy, and monospace. But each generic family has many other families (family-name).
Syntax
font-family : list of family-names, generic-family
Property values
generic-family
serifDefault
-
The fonts that proportionaly-spaced and have thick or thin strokes than fonts.
font-family: serif;
sans-serif
-
sans-serif means without sharp strokes. The fonts that have plain stroke endings i.e. there are sharp or cross strokes.
font-family: sans-serif;
cursive
-
They are not formal type fonts. They look as if they have been written by a brush or hand.
font-family: cursive;
fantasy
-
fantasy fonts are more decorative and contain expressive representation of characters.
font-family: fantasy;
monospace
-
It looks like computer code. It represents text as if typed by a keyboard.
font-family: monospace;
list of families
-
We may use comma separated list of family names. This list should end up with a generic-family.
And if one family is not rendered by the browser, the next one will be used. If all the families are not rendered by browser, the generic-family must be used.
font-family: courier, monospace;
Applicable to
It applies to all elements
From web4college, the free CSS digger
#CSS digger
Was this article helpful?