• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Basic (X)HTML Formatting > Making Text Bold or Italic

Making Text Bold or Italic

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

To make text bold

1.
Type <b>.

2.
Type the text that you want to make bold.

3.
Type </b>.

To make text italic

1.
Type <i>.

2.
Type the text that you want to make italic.

3.
Type </i>.

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

<h1>Barcelona Night Life</h1>

<p>Barcelona is such a great place to live. People
there really put a premium on <b>socializing</b>.
Imagine it being more important to go out with your
friends than to get that big promotion. Even when
you're, gasp, <i>pushing 30</i>. They say there
are more bars in Barcelona than in the rest of the
European community <i>combined</i>.</p>
					

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


Tips

  • You can also use the less common em and strong tags to format text (Figures 4.3 and 4.4). 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. Both require opening (<em>, <strong>) and closing tags (</em>, </strong>).

    Figure 4.3. If you prefer, you can use the em and strong tags for emphasizing text.

    <h1>Barcelona Night Life</h1>
    
    <p>Barcelona is such a great place to live. People
    there really put a premium on <strong>socializing
    </strong>. Imagine it being more important to go
    out with your friends than to get that big promotion.
    Even when you're, gasp, <em>pushing 30</em>.
    They say there are more bars in Barcelona than in
    the rest of the European community
    <em>combined</em>.</p>
    

    Figure 4.4. Most browsers display em with italics and strong with bold.

  • You may use cite (for citations), dfn (for definitions), and var (for variables) to make text italic, although they are less widely used than the i tag.

  • The address tag—old-fashioned but still valid—is another logical tag for making text italic. It’s usually only used to format the Web page designer’s e-mail address.

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


  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint