CSS font-family Property
CSS font-family Property
CSS font-family
property specifies the font for an element.
This property can have several fallback fonts in its value. These values are separated by commas to indicate that they are alternatives. The browser will select the first font in the list that is installed or that can be downloaded using a @font-face
at-rule.
Example
Syntax
Using CSS
Using Javascript
Animatable
No, font-family property is not animatable. CSS Animatable Properties Reference.
Default Value
Default value for CSS font-family property is depends on the user agent (browser).
Property Value
The following table provides a list of values for CSS font-family
property.
Value | Explanation |
---|---|
family-name generic-name | Specifies the name of a font family. Refer the list of all font-family in this example program. |
All in One
In the following example, we will demonstrate all values of CSS font-family
property.
Example
Demonstrating fallback fonts
In the following example, we will demonstrate how fallback fonts are useful.
Example
Using JavaScript
In the following example, we will demonstrate how to change the CSS font-family
property of an element using JavaScript.
Example
Reminder
Hi Developers, we almost covered 98.7% of CSS Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in CSS.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.