Chapter 18. Font and Text Properties

Cascading Style Sheets offer a degree of control over text formatting that approaches desktop publishing. This certainly comes as a relief after years of misusing HTML markup for presentation purposes. Controls for specifying fonts and text formatting are undeniably the most popular use of style sheets and they are the properties that browsers support the most reliably.

This chapter discusses the challenges of typography on the Web and introduces the following text-related CSS 2 properties:

font-family

text-decoration

letter-spacing

font-size

text-transform

word-spacing

font-weight

line-height

white-space

font-style

text-indent

direction

font-variant

text-align

unicode-bidi

font

vertical-align

 

Tip

Text color is discussed in the "Foreground Color" section of Chapter 20.

Get Web Design in a Nutshell, 3rd Edition 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.