Back to CSS1 Reference | CSS1 Properties
Prev font | Next font-size


Property
font-family
Values
<family-name>, <generic-family> (see below)
Initial
UA specific
Inherited
yes

The value is a prioritized list of font family names and/or generic family names. Unlike most other CSS1 properties, values are separated by a comma to indicate that they are alternatives:

      BODY { font-family: gill, helvetica, sans-serif }

There are two types of list values:

<family-name>
The name of a font family of choice. In the last example, "gill" and "helvetica" are font families.
<generic-family>
In the example above, the last value is a generic family name. The following generic families are defined:
Style sheet designers are encouraged to offer a generic font family as a last alternative.

Font names containing whitespace should be quoted:

      BODY { font-family: "new century schoolbook", serif }
      
      <BODY STYLE="font-family: 'My own font', fantasy">

If quoting is omitted, any whitespace characters before and after the font name are ignored and any sequence of whitespace characters inside the font name is converted to a single space.