-
Book Overview & Buying
-
Table Of Contents
Responsive Web Design with HTML5 and CSS3
By :
For years we've made do with a boring selection of web safe fonts. When some fancy typography was essential for a design, we've typically substituted a graphical element for it and used a text-indent rule to shift the actual text from the viewport.
There have been a few further options for adding fancy typography to a page. sIFR (http://www.mikeindustries.com/blog/sifr/) and Cufón (http://cufon.shoqolate.com/generate/) used Flash and JavaScript respectively to re-make text elements appear as the fonts they were intended to be. However, with a responsive design, we want a lean, mean, content-serving machine, and images and code flab should be avoided where possible. Thankfully, CSS provides a means of custom web typography that is now ready for the big time.
The @font-face CSS rule has been around since CSS2 (but subsequently absent in CSS 2.1). It was even supported partially by Internet Explorer 4 (no, really)! So what's it doing here, when we...
Change the font size
Change margin width
Change background colour