font-family
Published Jun 29, 2021Updated Sep 3, 2021
Contribute to Docs
Specify the typeface in a rule set.
Syntax
font-family: <font-family-name>;
where <font-family-name>
can be the following:
Roboto
"Open Sans"
- or can be selected from Google Fonts that suites you.
If a font family name is not available, browsers will display their default font. When using a multi-word font name, it is best practice to wrap them in quotes.
Example 1
Set the p
tag to Roboto
:
p {font-family: Roboto;}
Example 2
Set the h1
tag to "Open Sans"
:
h1 {font-family: 'Open Sans';}
All contributors
- Anonymous contributorAnonymous contributor3077 contributions
- Anonymous contributorAnonymous contributor51 contributions
- christian.dinh
- Anonymous contributor
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.