4.2 Strong & em | HTML

4.2 Strong & em
Table of Contents

The <strong> and <em> elements are used in HTML to emphasize text in different ways.

Usage of <strong>

The <strong> element is used to indicate text that has strong emphasis, typically displayed in bold by browsers.

Example:

<p>This is <strong>important</strong> information.</p>

In the example above, "important" will be displayed in a way that indicates strong importance.

Usage of <em>

The <em> element is used to indicate text that has emphasis, typically displayed in italics by browsers.

Example:

<p>This is <em>emphasized</em> text.</p>

In the example above, "emphasized" will be displayed in a way that indicates emphasis.

Both elements can be nested within each other to indicate text that is both strongly emphasized and has emphasis.

Example of Nesting <strong> and <em>

<p>This is <strong><em>strongly emphasized</em></strong> text.</p>

In the example above, "strongly emphasized" will be displayed with both strong emphasis (typically bold) and emphasis (typically italics).

I am a passionate writer. Read more.

Post a Comment

Don't spam links or promote stuff in the comments. It's annoying and lowers the conversation quality. Contribute respectfully and helpfully instead.