Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple fonts in Font-Family property?

Tags:

html

In the command

<span style="font-family: arial,helvetica,sans-serif">    <font size="1">        [Country]    </font> </span> 

Why are there multiple fonts in the font-family property?

Does it mean that if the arial font is not installed so it will goto helvetica?

like image 910
Royi Namir Avatar asked Aug 09 '11 13:08

Royi Namir


People also ask

Can multiple font families be specified to font-family property?

Yes. The font-family property can hold several font names as a "fallback" system.

Is it reasonable to have two generic fonts in a font-family rule?

Web authors should always add at least one generic family in a font-family list, since there's no guarantee that a specific font is installed on the computer or can be downloaded using a @font-face at-rule.

How do I use multiple font-family in CSS?

Start with the font you want, and always end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available. Note: Separate each value with a comma. Note: If a font name contains white-space, it must be quoted.

How do I request multiple font families?

To request multiple font families, separate the names with a pipe character ( | ). Requesting multiple fonts allows you to use all of those fonts in your page. (But don't go overboard; most pages don't need very many fonts, and requesting a lot of fonts may make your pages slow to load.)


1 Answers

Yes.

The font-family property can hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font.

From: http://www.w3schools.com/cssref/pr_font_font-family.asp

And as good practice:

Start with the font you want, and always end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available.

like image 139
FogleBird Avatar answered Sep 21 '22 16:09

FogleBird