Font Family in CSS
The font-family Property
The font-family property specifies the font for an element.
Types of a font family are:-
- font family: a specific font family (like Times New Roman or Arial)
- generic family: a group of font families with a similar look (like Serif or Monospace)
For your Information:-
The font-family property should hold several font names. When specifying a web font, adding more than one font will avoid unexpected behaviors. If the user's computer for some reason doesn't have the one you choose, it will try the next one.
Syntax:-
Its syntax is:-
< style >
element{
font-family: "Times New Roman", Times, serif;
}
< /style >
Further Explanation:-
Value | Description |
---|---|
family-name / generic-family | A prioritized list of font family names OR generic family names OR both. |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |