Code has been added to clipboard!

Web Safe Fonts: Learn About Font Stacks and Font Families

Reading time 3 min
Published Aug 8, 2017
Updated Oct 2, 2019

TL;DR — Web safe fonts are fonts that work on the majority of operating systems. To ensure the best browser compatibility, you should learn to font stack: create lists of fonts in the order of preference.

What web safe fonts are

Web safe fonts refer to fonts installed into most of the operating systems. Therefore, there is a higher chance for web safe fonts to be presented equally to all users. CSS calls such fonts as generic font families.

However, since CSS3, developers can use web fonts for their websites. Web fonts allow you to set custom fonts to be downloaded with your web page. As a result, there are more options for styling texts.

Creating font stack

The CSS font stack refers to a list of fonts defined in the font-family declaration. Every font in the list is a fallback in situations when fonts cannot load.

Therefore, the CSS font stacks help you control the way your page looks in cases when the main font (first in the list) does not work on users' devices.

Here is an example of a CSS font list:

Example
p {
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

Note: the CSS fonts lists should end with the generic name.

The following sections explain the five generic font families.

Serif fonts

font-family Text Example
Georgia, serif Example Heading

Example paragraph

"Palatino Linotype", "Book Antiqua", Palatino, serif Example Heading

Example paragraph

"Times New Roman", Times, serif

Example Heading

Example paragraph

Sans-serif fonts

font-family Text Example
Arial, Helvetica, sans-serif

Example Heading

Example paragraph

"Arial Black", Gadget, sans-serif

Example Heading

Example paragraph

"Comic Sans MS", cursive, sans-serif

Example Heading

Example paragraph

Impact, Charcoal, sans-serif

Example Heading

Example paragraph

"Lucida Sans Unicode", "Lucida Grande", sans-serif

Example Heading

Example paragraph

Tahoma, Geneva, sans-serif

Example Heading

Example paragraph

"Trebuchet MS", Helvetica, sans-serif

Example Heading

Example paragraph

Verdana, Geneva, sans-serif

Example Heading

Example paragraph

Cursive fonts

font-family Example text
"Comic Sans MS", Comic Sans, cursive

Example Heading

Example paragraph

Apple Chancery, cursive

Example Heading

Example paragraph

Bradley Hand, cursive

Example Heading

Example paragraph

Brush Script MT, Brush Script Std, cursive

Example Heading

Example paragraph

Snell Roundhand, cursive

Example Heading

Example paragraph

URW Chancery L, cursive

Example Heading

Example paragraph

cursive

Example Heading

Example paragraph

Fantasy fonts

font-family Example text
Impact, fantasy

Example Heading

Example paragraph

Luminari, fantasy

Example Heading

Example paragraph

Chalkduster, fantasy

Example Heading

Example paragraph

Jazz LET, fantasy

Example Heading

Example paragraph

Blippo, fantasy

Example Heading

Example paragraph

Stencil Std, fantasy

Example Heading

Example paragraph

Marker Felt, fantasy

Example Heading

Example paragraph

Trattatello, fantasy

Example Heading

Example paragraph

fantasy

Example Heading

Example paragraph

Monospace fonts

font-family Example text
"Courier New", Courier, monospace

Example Heading

Example paragraph

"Lucida Console", Monaco, monospace

Example Heading

Example paragraph

FreeMono, monospace

Example Heading

Example paragraph

OCR A Std, monospace

Example Heading

Example paragraph

Tutorial
CSS3 Features
Syntax
Classes
ID Selectors
Attribute Selectors
Stylesheets
Inline
Internal
External
Box Model
Children Selectors
Pseudo Classes
Pseudo Elements
Variables
Counters
Text
Fonts
Web Fonts
Backgrounds
Background Images
Colors
Gradients
Opacity / Transparency
Shadow Effects
Transitions
Tooltip
Transform
Animations
Layout — Display
Layout — Position
Layout — Float
Layout — Clear
Layout — Horizontal & Vertical Align
Multiple Columns
Introduction
Responsive Web Design — Viewport
Responsive Web Design — Grid View
Responsive Web Design — Media Queries
Responsive Web Design — Flexbox Layout
Responsive Web Design — Images
Responsive Web Design — Videos
Borders
Margin
Padding
Width
Height
Outline
Links
Lists
Tables
Dropdown Menu
Navigation Bar
Images
Image Gallery
Border Images
Forms
Rounded Corners
Buttons
Box-Sizing
Selector Reference
Pagination Examples
Code Examples
CSS3 Browser Support Reference
Functions Reference
Speech Module Reference
Units
Web Safe Font Combinations
Cheat Sheet
:hover
@font-face
@keyframes
@media
align-content
align-items
align-self
all
animation
backface-visibility
background
background-clip
background-color
background-image
background-origin
background-position
background-size
border
border-image
border-radius
border-style
box-shadow
box-sizing
color
columns
filter
flex
flex-basis
flex-direction
flex-flow
flex-grow
flex-shrink
flex-wrap
font
font-family
font-size
font-size-adjust
font-stretch
font-style
font-weight
hanging-punctuation
justify-content
line-height
margin
offset
opacity
order
outline
overflow
padding
perspective
position
resize
tab-size
text-align
text-decoration
text-emphasis
text-transform
text-shadow
transform
transition-property
translate
vertical-align
word-break
word-wrap
z-index