i

Learn HTML and CSS in 10 Days

Font Family

The property of ‘font-family’ helps in declaring that which font and fallback can be utilized to show text. The font-family value contains several font names that should be separated by commas.

The 1st font which you will declare at the very left is the primary font. If the first one is not available, then the other options should be chosen according to their precedence from left to right.

It is to be noted that font names that have more than one word should be enclosed in quotation marks. In addition to that, the last font value should be a keyword value, which will be utilizing the default system font for the specified type, mostly serif or sans-serif.

body {

  font-family: "Times New Roman” Helvetica, Arial, sans-serif;

}

In the above code, Helvetica Neue is the most desired font to display.