HTML5 and CSS3, Second Edition

(singke) #1

Tip 25


Tip 25. Working with Fonts


Typography is important to user experience. The book you’re reading right
now has fonts that were carefully selected by people who understand how
the right fonts and the right spacing can make it much easier for readers.
These concepts are just as important to understand on the Web.

The fonts we choose for conveying our message to our readers impact how
our readers interpret that message. Here’s a font that’s perfectly appropriate
for a loud heavy-metal band:

But that might not work out so well for the cover of this book:


As you can see, choosing a font that matches your message is really important.
The problem with fonts on the Web is that we web developers have been lim-
ited to a handful of fonts, commonly known as “web-safe” fonts. These are
the fonts that are prevalent across most users’ operating systems.

To get around that, we’ve historically used images for our fonts and either
directly added them to our page’s markup or used other methods, like CSS
background images or sIFR,^5 which renders fonts using Flash. CSS3’s Fonts
module offers a much nicer approach.


  1. http://www.mikeindustries.com/blog/sifr


Chapter 8. Eye Candy • 164


Download from Wow! eBook <www.wowebook.com> report erratum • discuss

Free download pdf