Name

font-family

Values:

[[<family-name> | <generic-family>],]* [<family-name> | <generic-family>] | inherit

Initial value:

User agent-specific.

Applies to:

All elements.

Inherited:

Yes.

Computed value:

As specified.

Description:

This defines a font family to be used in the display of an element’s text. Note that use of a specific font family (e.g., Geneva) is wholly dependent on that family being available on a user’s machine; no font downloading is implied by this property. Therefore, using generic family names as a fallback is strongly encouraged. Font names that contain spaces or nonalphabetic characters should be quoted to minimize potential confusion.

Examples:

p {font-family: Helvetica, Arial, sans-serif;}
li {font-family: Times, TimesNR, "New Century Schoolbook",
serif;}
pre {font-family: Courier, "Courier New", "Andale Mono",
Monaco, monospace;}

Supported by:

Firefox, Internet Explorer, Opera, Safari.

Get CSS Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.