


Their use at the end of a multiple font family list is advisable.Īdvertise Here! On a long-established, well-read, well-respected web development resource. The different font-family is used for making. This property can hold multiple font names as a fallback system, i.e., if one font is unsupported in the browser, then others can be used. It sets the font-face for the text content of an element. While it’s perfectly legit to use the serif, sans-serif, monospace, cursive, and fantasy generic font family names, they are designed as a fallback for when preceding font families are not recognised. This CSS property is used to provide a comma-separated list of font families. font-family: "Times New Roman", for example. A browser will apply the first font in that list that is is capable of applying.įont names that are made up of more than one word should be placed inside quotation marks.

If none are available, it will use the default browser font. When using the font-family property, the users browser will display the text using the first available font that you specify. apply this rule to all elements, all ::before pseudo-elements. selects every element, ::before and ::after are CSS pseudo elements, comma is how you seperate elements you’re applying rules to in CSS. Note: Backticks () are not single quotes (’). Daft font, like Papyrus.Ī comma-separated list of font family names. The CSS font-family property allows you to specify a prioritized list of font family names (for example, Times or Arial) and/or generic family names (for example, serif or sans-serif). See this post to find the backtick on your keyboard. Sans-serif font, like Arial or Helvetica. Serif font, like Times or Times New Roman. Fonts are not CSS-specific and need to be either installed on a user’s computer or downloaded for CSS to grab hold of them and apply them. This can be a single font or a comma-separated list, of which a browser will apply the first font it can use (such as one installed on a user’s computer).įont family can also be specified as part of the font shorthand property.
