Emphasizing HTML Text

There are a couple of useful HTML tags that we can use to give extra emphasis to certain words. Back in the olden days of HTML 4.0 it was common to use the italics tag <i> and the bold tag <b>. However, these have been replaced by the emphasis tag <em> and the strong tag <strong>. By default these display in italics and bold respectively, so we can use them as a direct replacement. Plus these new tags are compliant with the latest XHTML standards, whereas the old italics and bold tags are not, so make sure you use the right ones.

The emphasis and strong HTML tags are used in the same way as other tags - we place the opening tag before the text we want to emphasize, and the closing tag after it.

Try the following example:

<html>
<head>
<title>Emphasizing text</title>
</head>

<body>

<p>Use the emphasize tag to make text <em>stand out</em><p>

<p>Use the strong tag to apply <strong>strong emphasis!</strong></p>

</body>
</html>

This will produce the following result:

Use the emphasize tag to make text stand out

Use the strong tag to apply strong emphasis!