O'Reilly logo

HTML, XHTML, and CSS Bible, Fifth Edition by Steven M. Schafer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Character Formatting Essentials

IN THIS CHAPTER

  • Methods of Text Control

  • Bold and Italic Text

  • Use of Emphasis Instead of Italics

  • Monospace (Typewriter) Fonts

  • Superscripts and Subscripts

  • Abbreviations

  • Marking Editorial Insertions and Deletions

  • Grouping Inline Elements with the Span Tag

Although the modern-day Web is a haven of multimedia, text is still vitally important. Only through text can some messages be succinctly communicated. Even then, diversity in text can help further clarify a message. For example, emphasizing one word with bold or italic font can change the entire tone and meaning of a sentence.

This chapter discusses the tags you can use to format elements inside of block elements (characters, words, or sentences inside of paragraphs).

Methods of Text Control

You can control the look and formatting of text in your documents using various means. It should come as no surprise that the more direct methods—<font> tags and the like—have been deprecated in favor of CSS controls in HTML 4.01 and XHTML. For historical context and completeness, the following sections cover the various means possible.

Tip

Although it is sometimes easier to drop a direct formatting tag into text, resist the urge and use styles instead. Your documents will be more flexible and more standards-compliant.

The <font> tag

The <font> tag enables you to directly affect the size and color of text. Intuitively, the size attribute is used to change the text's size; the color attribute is used to change the color. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required