Learning XHTML


Home

XHTML 101

Lesson 1
Basic Tags
Global Structure
HTML vs XHTML

Lesson 2
Using <p>, </p> and <br />
XHTML Headers
Strong and Emphasis

Lesson 3
Using <blockquote> </blockquote>

Lesson 4
Changing the Font with CSS

 

Email
John Wilfong


XHTML 101
Lesson 2 - Part 3
Strong and Emphasis

If you learned HTML before you learned XHTML, you probably know about the bold and italics tags. But these tags are not true XHTML elements because they define how the text should look rather than information about the text. That's why they have been generally replaced by strong (for bold) and emphasis (for italics).

The strong and emphasis elements add interest to your text. Unlike some other XHTML tags, they are meant to look the same on all browsers. Simply surround your text with the opening and closing tags (<em> and </em> for emphasis and <strong> and </strong> for strong emphasis ).

You can nest these tags and it doesn't matter which is the external tag.

This text is emphasized most browsers display it as italics.
This text is strongly emphasized most browsers display it as bold.
This text is both strong and emphasized usually displayed as bold and italics.

The above would be coded as:
<em>This text is emphasized</em> most browsers display it as italics.

<strong>This text is strongly emphasized</strong> most browsers display it as bold.

<strong><em>This text is both strong and emphasized </em></strong> usually displayed as bold and italics.