A 'font-family' is a group of fonts that exhibit similar characteristics.
The 'font-family' property indicates a prioritized list of specific/generic
font family names to use to display text content in the current container.
At least one specific or general font family must be given. If the
specified font does not exist, or the necessary glyph is not available
in the specified font, the next font is tried. This process continues
through the prioritized list until no more are available. If no match
is made, the browser default font family should be used.
Explicitly sets the value of this property to that of the parent.
serif | sans-serif |
cursive | fantasy |
CSS1 | CSS2
| IE3 | N4B2
These values refer to generic font families that have certain visual
characteristics. Browsers will attempt to map an existing font for the
selection using this generic family specification. It is recommended to
offer a generic font family value as a last alternative after specifying
specific font family names.
CSS1 | CSS2
| IE3B1 | N4B2
This value will be a string identifying a specific font. Font names
containing white space should be quoted (else the value is normalized.)
- There is little agreement about what constitutes a font from
the "cursive" and "fantasy" generic font-families.
- Use of font family names containing spaces is not supported
for inline styles. External and embedded styles are OK.
- Using a list of fonts for the Font-family value can cause
subsequent declarations in a style rule to fail. The easy fix
for this behavior is to list the Font-family property last in
any style rule.
- Font-family names containing spaces should be contained in
double or single quotes. The declaration must also be explicitly
terminated by a semi-colon (which should be optional if no other
declarations follow it in the rule) for subsequent rules to be
- The "Cursive" generic font-family appears to be treated as
"Serif" and "Fantasy" appears to be treated as "Sans-Serif."
- Listing an unknown font, followed by a known font does not use the
known font-family. It uses instead the default font-family.