What is the significance of giving multiple font family name

Ghanshyamji Gupta

For a project I download a template. In its style.css font family was defined as

body {
    font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
}

arial , sans-serif, Helvetica Neue are different font families then why font-family in css is defined as above.

Tushar

Not all browsers support all the fonts.

So, giving multiple font families select the font that is supported by the browser, starting from the first font. If first font is supported then it is used, otherwise it checks if next font is supported and so on. The leftmost font that is supported is used.

font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;

In this case, Lato is not supported by all browsers. So, next font Helvetica Neue is checked.

You'll also notice that the last fonts are common, that are supported by all browsers Arial and sans-serif in this case.

FROM MDN

The font-family CSS property lets you specify a prioritized list of font family names and/or generic family names for the selected element. Values are separated by a comma to indicate that they are alternatives. The browser will select the first font on the list that is installed on the computer or that can be downloaded using a @font-face at-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. The generic family lets the browser select an acceptable fallback font when needed.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Set matplotlib font by family name when there are multiple fonts with same name

What's the default font family?

What is the meaning of font-family?

What is the default font family in Android?

What is the difference between font and font family?

Ubuntu Font Family and Mac OS X confusing font name and font

Get font family name from QFontDatabase::addApplicationFont

How to use font-family with same name?

what is the significance of schema name in SQL server

What is the default font family of a Flutter app?

WPF multiple Font files of the same family

HTML: Significance of Label Name for Radio-Controlled Font Awesome Icons

How can i get list of font family(or Name of Font) in matplotlib

What is correct to specify as CSS font-family value: typeface, font or font-family?

Can I define multiple Font-Family names for the same font?

What is the name of this Font?

how to set the UIFont family and name with display font on the UITableView?

What is the significance of the reverse domain name for java package structure

What is the significance of the numbers in the name of the flush processes for newer linux kernels?

In Python what is the significance of parentheses, in isolation, surrounding a module name?

What is the significance of the number in [xx] after the project name in XCode build console

What is the font family of the close/minimize/reduce button in Windows 10?

What is the CSS (font-family, size) for a blockquote in Bootstrap

What is the default font family in HTML and how can I check this?

How get to know what font family does anchor element use

How to find out what font family is used by a paragraph in OOXML?

Flutter : How to include multiple font family in one paragraph?

In reshape function of Numpy, what is the significance of giving three parameters, where the first one is -1?

What is the name of the new ubuntu font?

TOP Ranking

HotTag

Archive