Chapter 7. Formatting Text

Designers accustomed to desktop publishing programs are usually shocked to find how little control HTML offers over the display of the page. Before you get too frustrated, bear in mind that HTML was not developed as a method for dictating presentation, but rather as a means of marking the structure of a document.

In fact, the tags that do provide specific display information (<center>, for example) are usually just bastardizations of the pure HTML concept. One day, we’ll put all of our style and presentation information in style sheets and leave HTML markup to work as originally designed. But that’s another story (one told in Chapter 23).

This chapter looks at the nature of text in web pages and reviews the HTML tags related to the display of text elements.

Summary of Text Tags

This section is a listing of tags used for formatting text. It is divided into the following subgroups:

  • Paragraphs and Headings (Block-Level Elements)

  • Text Appearance (Inline Styles)

  • Spacing and Positioning

  • Lists

Browser support for each tag is noted to the right of the tag name. Browsers that do not support the tag are grayed out. Browsers that deprecate the tag are noted with a superscript D. Tag usage is indicated below the tag name. A more thorough listing of attributes for each tag, according to the HTML 4.0 Specification, appears in Appendix A.

Paragraphs and Headings (Block-Level Elements)

Block-level elements are always formatted with a line-break before and after, with most adding ...

Get Web Design in a Nutshell 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.