Chapter 10. 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 designing how the page looks, 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 not true to the original HTML concept. In an ideal world, all style and presentation would go in style sheets, leaving HTML markup to work as originally designed. The W3C has made these intentions clear by deprecating in the HTML 4.01 specification nearly all tags that control presentation in favor of Cascading Style Sheet controls (see Chapter 17).

This chapter looks at the nature of text in web pages and reviews the HTML tags related to the structure and presentation 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

In this section, browser support for each tag is noted to the right of the tag name. Browsers that do not support the tag are grayed out. Tag usage is indicated below the tag name. Start and end tags are required unless otherwise noted. “Deprecated” means that the tag or attribute is currently supported but is due to be phased out of the HTML ...

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