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
From the course: CSS Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Typography for the web3m 32s
-
(Locked)
Changing fonts with font-family2m 18s
-
(Locked)
Working with font-weight and font-style1m 48s
-
(Locked)
Web fonts with @font-face1m 56s
-
(Locked)
Online font services3m 54s
-
(Locked)
Project: Add custom fonts4m 38s
-
(Locked)
The font-size property3m 19s
-
(Locked)
Font size and accessibility4m 32s
-
(Locked)
Text-align, text-transform, and text-decoration3m 28s
-
(Locked)
Line-height and letter-spacing2m 49s
-
(Locked)
Project: Font and text styles8m 28s
-
(Locked)
Project: Button styles7m 3s
-
(Locked)
Project: Borders, spacing, and color11m 38s
-
(Locked)
-
-