Chapter 7. Working with Fonts

One of the benefits of using CSS is the flexibility it provides for working with fonts. With HTML, you're limited to working with only seven standard font sizes; with CSS, you can specify an unlimited range of font sizes. Besides specifying specific fonts that you want to display, you can also specify a generic font family as a fallback, in case none of your specified fonts are available. You can also change the font weight and set different font variants and styles (italic, oblique, and small caps, for instance).

As discussed previously, HTML's FONT tag is deprecated in HTML 4 in favor of using styles to achieve the same or better results. In this section, you review examples of how to exclusively use CSS styles ...

Get Cascading Style Sheets (CSS) by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.