From the course: CSS Essential Training

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Changing fonts with font-family

Changing fonts with font-family

From the course: CSS Essential Training

Changing fonts with font-family

- [Instructor] The font family property sets the typeface for an element. Its value is a comma separated list called a font stack with options listed in order of preference. The browser will display the first font in your list, your preferred font if it's installed on the user's device. If not, it will try the next option until one becomes available. So your lists should include similar alternatives. You can list any number of font options, but it must always end with a generic font family. Generic font families are fallback fonts defined by the browser. They help maintain a look similar to the intended style when the specific fonts are unavailable. The exact font varies across devices and operating systems. Generic font families are defined with keywords, serif, sans-serif, and monospace, which are used as fallbacks for the corresponding category of typefaces. Cursive is usually used as fallback for script or display…

Contents