From the course: CSS Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Changing fonts with font-family

Changing fonts with font-family - CSS Tutorial

From the course: CSS Essential Training

Changing fonts with font-family

- [Instructor] In CSS, the font-family property is used to define the typeface of an element. The value is declared as a list, also known as a font stack. It contains multiple font-family options, arranged by priority from highest to lowest. The browser displays the first font in the list. If it's not installed on the user's computer, it will try the next option until it finds an available font. The font stack should include similar fallback options and always includes a generic font family as the last option. Generic font families are defined by the browser and the exact font will vary across devices and operating systems. Also, they don't refer to specific typefaces but rather, categories of fonts with similar characteristics. The available keyword values for generic font families are serif, sans-serif, and monospace, which are used as fallbacks for the corresponding category of typefaces. cursive is usually used…

Contents