Search within TutorialsPark

CSS font-family Property


To specify the font-family for the block of text


Definition and Notes.

1. The CSS font-family property specifies the font family to be used to display a block of text.

2. Note that the specific font-family depends on the family being available on the device. Hence the generic family should be specified as well, as a fallback mechanism.

Eg: Font-Stack

Generic Family: Its a group of font-family that have a similar appearance. Eg: Serif, Sans-Serif, Monospace

Font Family: Its a group of a series of fonts that have a similar appearance. Eg: Times , Verdana, Arial

Font : Its a specfic version of font from a given font-family. Eg: Arial, Arial Black, Arial Italic.

Syntax:

CSS font-family property. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note-Font names are not case sensitive, hence "TIMES NEW ROMAN" and "times new roman" have the same meaning.

Property Values

Value Description
<family-name> To denote the name of the font-family. Font family name with whitespaces should be within quotes. Eg: "Times New Roman"
<generic-family> To Denote the generic font-family, its a fallback mechanism, incase the specified fonts are not available.

Specifications

Specs Value
Name font-family
Value [<family-name> | <generic-family>] #
Initial Value Browser Specific
Applies to all elements
Javascript syntax object.style.fontFamily="Verdana"
Inherited Yes
Computed Value Same as declared Value.
Browser Support internetexplorer safari firefox opera chrome

Related Examples.