Specify how fonts should degrade using CSS


 Specify how fonts should degrade:

  • There are several default fonts that are available in all browsers. These generic font families include monospace, serif, and sans serif.
  • When one font isn't available, you can tell the browser to "degrade" to another font.
  • For example, if you wanted an element to use the Helvetica font, but degrade to the sans serif font when Helvetica isn't available, you will specify it as follows:

p {
  font-family: Helvetica, sans-serif;
}

  • Generic font family names are not case-sensitive. Also, they do not need quotes because they are CSS keywords.

No comments:

Post a Comment