10. Formatting with Styles
As we saw in Chapter 4, Basic (X)HTML Formatting, (X)HTML has a rather limited repertoire of text formatting options. Thankfully, CSS offers many more possibilities.
With CSS, you can change the font face, size, weight, slant, line height, foreground and background color, spacing and alignment of text, decide whether it should be underlined, overlined, struck through, or blinking, and convert it to all uppercase, all lowercase, or small-caps. And you can apply those changes to an entire document or an entire site. In this chapter, you'll learn how.
Figure 10.1. Here is what the page looks like with no style sheet applied. You can find the source XHTML code in the Examples section of my site: http://www.cookwood.com/html6ed/examples/
I should probably also note that while many of the properties discussed in this chapter apply mostly to text, that doesn't mean they only work with text. Many of them work just fine on other kinds of content as well.
We'll continue on with CSS layout in Chapter 11, Layout with Styles.
|Choosing a Font Family|
|Specifying Alternate Fonts|
|Applying Bold Formatting|
|Setting the Font Size|
|Setting the Line Height|
|Setting All Font Values at Once|
|Setting the Color|
|Changing the Text's Background|
|Setting White Space Properties|
|Changing the Text Case|
|Using Small Caps|