From the course: CSS Essential Training

Unlock the full course today

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

Web fonts with @font-face

Web fonts with @font-face - CSS Tutorial

From the course: CSS Essential Training

Web fonts with @font-face

- Typography is an important part of web design and in the past, the options of available fonts were limited to a small selection of web-safe fonts. However, with the introduction of the CSS @font-face rule, our options have expanded to include web fonts. This means that instead of relying on fonts installed on a user's computer, font files can now be downloaded along with your website just like any other resource, such as images or PDFs. Web fonts are added using the @font-face rule. The syntax looks similar to the CSS declarations we've been writing so far, but we're not selecting or applying styles to any elements. Instead, we're writing instructions. Let's take a closer look at each part. Start the declaration with @font-face and the curly brackets. This must be declared in your style sheet before you can use your font, then add font-family. In this context, it's used to define the name of the font family. You can…

Contents