Languages
[Edit]
EN

CSS - font-family

0 points
Created by:
Elias999
819

In this article, we would like to show you how to use font-family property in CSS.

Quick solution:

multiple: 

 

Introduction

Edit

The font-family property is used to set the font for an element. You can specify multiple font names because if the browser doesn't support the first font from the list, it tries the next one.

The fonts:

  • should be specified in the correct order, starting from the one you want the browser to try first and so on,
  • they should be separated by a comma,
  • if a font name contains white space, it has to be quoted.

Practical example

Edit

In the example below, we specify three different font styles for div elements.

Multiple fonts

Edit

In this example, we combine the fonts from the previous section in the order we want them to be displayed. If the browser doesn't support Courier New, it will try to use Arial, then Verdana, etc.

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join