The font-family property defines the font family that the text should be displayed in.
font-family in CSS Versions:
font-family: [[family-name | generic family-name],]* [family-name | generic family-name] | inherit
The specific font family to be used.
- generic family-name
A generic font family that allows the user-agent to pick the most suitable match. Options are:
The element should have the same font-family setting as the parent.
font-family Initial Value:
Depends upon the browser or user-agent. There is no standards defined initial font-family value.
font-family Applies To:
This property is inherited.
font-family Browser Support:
Choose a single font for a paragraph
Provide a list of similar fonts for the browser to use the first available
<p style="font-family : courier new;"> This paragraph is in courier new </p>
<p style="font-family : geneva, arial, helvetica, sans-serif;"> This paragraph would like to be geneva, but may be another sans-serif font. </p>
font-family Special Notes:
- Font families with whitespace in their names should be quoted.
- If the computer viewing your page doesn't have the font specified, the browser will guess. This can cause strange effects. It is best to use standard fonts, or the generic font names.
- When you use the generic font names, the computer will choose the font on the system most appropriate. Different Web browsers choose different fonts for the same generic font-family. Always test your page on different computers and different browsers.