Hour Twelve: Alignment and Spacing
Control over text formatting enables you to replace many HTML tags with CSS rules. Effects that were previously available only as presentational markup attributes are now part of the Cascading Style Sheets specification and can help you separate presentation from content.
In this hour, you'll learn
- How to align, justify, and center content using CSS
- How to indent paragraphs and other HTML elements
- How to make text that rises above or below the rest of the text, such as subscripts or superscripts
- How to control the spaces between letters and words
- How to control line breaks and duplicate the HTML <pre> and <nobr> tags
- How to adjust the spacing between lines
Sample Code
You can download the sample code from each hour as one package or individual files.
- Download all [5K tar.gz file]
- Twain's War Prayer [HTML]
- Listing 12.1 [CSS]
- War Prayer with style sheet 12.1 [HTML]
- Listing 12.2 [CSS]
- War Prayer with style sheet 12.2 [HTML]
- Listing 12.3 [CSS]
- War Prayer with style sheet 12.3 [HTML]
- Vertical alignment demo [HTML]
- Listing 12.4 [CSS]
- Listing 12.5 [CSS]
- War Prayer with style sheet 12.5 [HTML]
Web Links
This chapter contains no Web links.
Updates and Errata
There are currently no updates to this hour's content.