Making Text Bold or Italic

One way to make text stand out is to format it in boldface or italics.

To make text bold:


Type <b>.


Type the text that you want to make bold.


Type </b>.

To make text italic:


Type <i>.


Type the text that you want to make italic.


Type </i>.

Figure 4.1. You may use bold or italic formatting anywhere in your (X)HTML document, except in the title.


  • You can also use the less common em and strong tags to format text (Figures 4.2). These are logical formatting tags for "emphasizing" text or marking it as "strong". In most browsers, em is displayed in italics and strong in bold. On some browsers, though, they're displayed differently. For example, some handhelds can't display italics and use underlining instead.

    Figure 4.2. If you prefer, you can use the logical em and strong tags to add both structure and formatting at the same time.

  • You may also use cite (for citations), dfn (for definitions), and var (for variables) to make text italic while giving information about the content.

  • The address tagold-fashioned but still validis another logical tag for making text italic. It's usually only used to format the Web page designer's email address.

  • For more control over bold and italics, try style sheets. For details, consult Creating Italics on page 154 and Applying Bold Formatting on page 155.

Figure 4.3. Bold and italic formatting are the simplest and most effective ways to make your text stand out.

HTML, XHTML, & CSS(c) Visual QuickStart Guide
HTML, XHTML, and CSS, Sixth Edition
ISBN: 0321430840
EAN: 2147483647
Year: 2004
Pages: 340

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: