Text Emphasis
So far you've learned how to add text, but here you will learn how to format it. You will occasionally want to add emphasis to your text to make it stand out. HTML enables you to quickly apply some standard formats, such as boldface and italic, using a predefined set of tags. All these tags occur in pairs (corresponding opening and closing tags) and must surround the text that they are emphasizing. Use the HTML code that follows in your own Web page to see how each of these tags appears in the browser.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Emphasizing Text</title> </head> <body> <p>Make your text one size larger with the <big>big tag.</big></p> <p>Try the <b>bold tag</b> or the <strong>strong tag</strong> to make an impact.</p> <p>The <i>italics tag</i> and the <em>emphasis tag</em> create a different impact.</p> <p>Use the <tt>teletype tag</tt> to imitate a typewriter.</p> <p>Make your text one size smaller with the <small>small tag.</small></p> </body> </html>
Caution
Other formatting tags exist in HTML, but their use is discouraged in HTML and deprecated in XHTML in favor of style sheets. The World Wide Web Consortium (W3C) has determined that HTML should be used to identify types of information (text, headings, tables, and so on), but should not be used to format that information.
Note
Deprecated Some older HTML tags, specifically related to formatting, have been replaced by the formatting capabilities of style sheets. Style Sheets Web developers use style sheets to specify formatting instructions for a single document or a group of documents.
You'll learn how to create style sheets in Lesson 5, "Adding Your Own Style." Throughout the book, however, you'll see how styles can enhance your Web pages.