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.

Web fonts with @font-face

Web fonts with @font-face

- Typography for the web was once limited to only web-safe fonts, but with the introduction of the CSS @font-face, our options expanded to include web fonts. This method allows us to link directly to the font files, which are then downloaded into the webpage. Users don't need to have the fonts installed on their devices to see them on the webpage. To use a custom font, a basic rule set starts with @font-face and two requirements: define the font name and specify the font source. @ rules look similar to CSS declarations, but they are statements that contain instructions. Font-family in this context is a descriptor and defines a name for the font. You can choose any name you'd like, but it's common practice to use the name of the typeface. Source is used to specify the location of the font file with the URL function in either a relative or absolute file path. Once the @font-face rule set has been defined, you can use your…

Contents