7.8 Web Fonts
In the Halloween Sounds web page, did you notice the scary-looking font for the text? In this section, we explore how you can incorporate such nonstandard fonts, called web fonts, into your web pages.
For standard fonts (such as Tahoma and Courier New), you can be reasonably confident that those fonts will be installed on users’ computers and they will work. But to be safe, you should always include a generic font family in each of your CSS font-family rules. On the other hand, nonstandard fonts will not normally be preinstalled on users’ computers, so to get them to work, you’ll need to use a CSS @font-face rule. They’re called at-rules because they use the @ symbol.
The W3C states that at-rules “define special processing rules ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access