For optimum typographic control, particular named fonts should be used in style sheets.Īll five generic font families are defined to exist in all CSS implementations (they need not necessarily map to five distinct actual fonts). Generic font families are a fallback mechanism, a means of preserving some of the style sheet author’s intent in the worst case when none of the specified fonts can be selected. The following generic family keywords are defined: ‘ serif‘, ‘ sans-serif‘, ‘ cursive‘, ‘ fantasy‘, and ‘ monospace‘. The name of a font family of choice, such as ‘Helvetica’ or ‘Verdana’ or ‘Open Sans’. Using this selection mechanism, rather than selecting a face via the style name as is often done in design applications, allows some degree of regularity in textual display when fallback occurs. CSS uses the combination of a family name with other style attributes to select an individual face. The font selection mechanism merely provides a way to determine the “closest” substitute when substitution is necessary.Ī font family defines a set of faces that vary in weight, width or slope. This means that if a font family does not contain a representation (or glyph) for a certain character, the browser will move on to the next font in the list and then the next one until it finds a glyph for that character in any of those fonts, and then it renders the character. The browser chooses the font family on a character basis-the browser iterates through the list of family names until it matches an available font that contains a glyph for the character to be rendered.
![list of font names list of font names](https://brandlance.com/media/business-names/list-of-international-brand-names.jpg)
In the above example, “serif” and “fantasy” are both generic family names provided at the end of the list, unquoted.įont family names that happen to be the same as a generic keyword value (“inherit”, “serif”, “sans-serif”, “monospace”, “fantasy”, and “cursive”) must be quoted to prevent confusion with the keywords with the same names. Since generic family names are keywords, they must not be quoted. Generic family names are usually keywords. When multiple font family names are specified, designers are encouraged to include a generic font family name at the end of the list to provide fallback for when the desired font families are not available. To avoid mistakes in escaping, if a family name contains multiple words, separated by spaces, digits, or punctuation characters other than hyphens, it is recommended to list the family name in quotation marks (single or double):įont-family: "New Century Schoolbook", serif Ī generic family name is a name that is usually used as a fallback mechanism, which tells the browser what kind of font family to use in case none of the specified font families are available. For example, the following declarations are invalid:įont-family: "Lucida" Grande, sans-serif This means most punctuation characters and digits at the start of each token must be escaped in unquoted font family names. There are two types of font family names: font family names and generic family names.Ī font family name is a name of an actual font, such as “Helvetica”, “Arial”, “Times New Roman”, “Open Sans”, “Lato”, etc.įont family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. If neither Helvetica nor Verdana is present, then the browser-defined sans serif font will be used. In the above example, if Helvetica is available it will be used when rendering. If none of the specified font families are available, the browser falls back to the default font specified in the system. If it is invalid or does not exits or if it fails to load the specified font, it tries to apply the second one, then the third, and the fourth, till the end of the list.
![list of font names list of font names](https://i.pinimg.com/originals/8a/0e/59/8a0e590df471f6d6a935e025f5211ec2.png)
![list of font names list of font names](https://www-k12.atmos.washington.edu/~ovens/gmt/doc/html/GMT_Docs/img242.png)
The browser will first apply the first family name specified in the list. The browser will select the font from the list that is installed on the computer, or that can be downloaded using the information provided by an at-rule.įont-family: Helvetica, Verdana, sans-serif The font family names specified are separated by commas, indicating that they are alternatives to each other. More specifically, it defines a prioritized list of font family names and/or generic family names that are to be used. The font-family property specifies the font family that is to be used for the content of an element.