CSS font-family property

CSS font-family property

Description

The font-family property allows authors to provide a comma-separated list of specific font families, along with a generic font family, to be used in the rendering of an element’s text.

Possible values

  • font-family – A comma-separated list of font families.

Applies to

All HTML elements.

DOM Syntax

object.style.fontFamily = "georgia,garamond,serif"; 

Example

Here is an example of using this property:


<html> 
<head> 
</head> 

<body> 
<p style = "font-family:georgia,garamond,serif;"> 
This text is rendered in either georgia, garamond, or the 
default serif font depending on which font you have at your system.
</p> 
</body> 
</html> 

This will produce the following –

CSS font-family property

Leave a Reply

Your email address will not be published. Required fields are marked *