/

HTML / CSS / JavaScript Tutorial

CSS Property: font-family

[this page | pdf | back links]

The CSS (CSS1) font-family property indicates the font to be used for an element. It can include several values, separated by commas (typically starting from more specific fonts and ending with more generic fonts). If the browser doesn’t support the first font in the list, it tries the next one etc. Font family names can be:

 

-        Specific, e.g. "Times New Roman", Arial; or

-        Generic, e.g.  serif, cursive

 

Valid property values (other than inherit and initial) are:

 

Value

Description

family-name / generic-family / list

A prioritised list of specific or generic font family names. Note: if a font name contains a space then it must be enclosed in quotes

 

Default Value:

Depends on browser

JavaScript syntax:

e.g. object.style.fontFamily="Verdana,serif"

Inherited:

Yes

Animatable:

No

 


NAVIGATION LINKS
Contents | Prev | Next | CSS Properties


Desktop view | Switch to Mobile