Languages
[Edit]
EN

CSS - safe fonts

0 points
Created by:
sienko
743

In this article, we would like to show you safe font families in CSS​​​​​.

Safe generic fonts

Edit
PreviewGeneric family name

font-family: serif;

font-family: sans-serif;

font-family: monospace;

font-family: cursive;

font-family: fantasy;

font-family: system-ui;

-

font-family: ui-serif;

-

font-family: ui-sans-serif;

-

font-family: ui-monospace;

-

font-family: ui-rounded;

-

font-family: emoji;

-

font-family: math;

-

font-family: fangsong;

Popular fonts

Edit

This group of fonts is guaranteed by the specific operating systems on which the browser is installed. They may look different depending on your operating system.

Note:

Go to the next section to see how to use multiple fonts to automatically match one of the available fonts.

Family nameGeneric family name

Arial

sans-serif

Verdana

sans-serif

Helvetica

sans-serif

Tahoma

sans-serif

Trebuchet MS

sans-serif

Times New Roman

serif

Georgia

serif

Garamond

serif
Courier Newmonospace
Monacomonospace

Brush Script MT

cursive
Bradley Handcursive
Luminarifantasy

Practical examples

Edit

Generic font family name:

Popular fonts:

Fonts stack:

Note:

It is a good practice to always include at least one generic family name in a font-family list, since there's no guarantee that any specified font is available.

External fonts

Edit

It is possible with HTML5 to load some external fonts such as Google Fonts or Font Awesome.

References

Edit
  1. font-family - CSS: Cascading Style Sheets | MDN
  2. CSS Fonts - Generic font families

Alternative titles

  1. CSS - safe font families
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