CSS | font-family Property
The font-family property specifies the font of an element. It can have multiple fonts as a backup system i.e. if the browser doesn’t support one font then the other can be used.
Syntax:
element_selector {
font-family: fonts-name|initial|inherit;
}
Property values:
- fonts-name: The names of the font in quotes separated by commas.
- initial: Sets the property to its default value.
- inherit: Inherits the property from the parent element.
Example:
<!DOCTYPE html> <html> <head> <title> CSS | font-family Property </title> <style> .para1 { font-family: "Impact", Times, serif; } .para2 { font-family: Arial, Helvetica, sans-serif; } </style> </head> <body> <h1>Font-family Property</h1> <p class="para1">GeeksforGeeks in Impact font</p> <p class="para2">GeeksforGeeks in Arial font.</p> </body> </html> |
chevron_right
filter_none
Output:

Supported Browsers: The browsers supported by font-family property are listed below:
- Google Chrome 1.0
- Internet Explorer 4.0
- Firefox 1.0
- Opera 3.5
- Apple Safari 1.0
Recommended Posts:
- HTML | DOM Style fontFamily Property
- CSS | transition-property Property
- CSS | nav-right property
- CSS | all Property
- CSS | nav-down property
- CSS | nav-up property
- CSS | top Property
- CSS | right Property
- CSS | grid-row-end Property
- CSS | clip Property
- Web API | DOMRect right property
- Web API | DOMRectReadOnly y property
- CSS | grid-gap Property
- CSS overflow-y Property
- Web API | DOMRectReadOnly x property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



