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.
Allowed Values
inherit
CSS2
Type: Explicit
Description:
Explicitly sets the value of this property to that of the parent.
serif | sans-serif |
cursive | fantasy |
monospace
CSS1 | CSS2
| IE3 | N4B2
| O3.5
Type: Calculated
Description:
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.
[specific font-family]
CSS1 | CSS2
| IE3B1 | N4B2
| O3.5
Type: Explicit
Description:
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.
Internet Explorer
3.0:
- 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
parsed correctly.
Netscape
4.x:
- The "Cursive" generic font-family appears to be treated as
"Serif" and "Fantasy" appears to be treated as "Sans-Serif."
Opera
3.5:
- Listing an unknown font, followed by a known font does not use the
known font-family. It uses instead the default font-family.