Table of Contents
INTRODUCTION
The HTML <em> element is used for text having stress emphasis compared to surrounding text. It is mostly used for a word or few words in sentence (similar to exclamation mark).
This text is shown by browser in italic style. A person or software reading the text would apply verbal stress to the words enclosed in <em> tags, pronouncing them with added emphasis.
Syntax:<em> - TEXT - </em>
Example:
<p>
<em>Wow!</em> That painting is so beautiful
</p>
Output:
Wow! That painting is so beautiful.
The <em> element should not be used to merely italicise text. You can use font-style property with value set to italic (font-family: italic;) for this purpose.
Tag Omission
The HTML <em> element must have both start tag and end tag.
ATTRIBUTES
The <em> element only has global attributes.
Frequently Asked Questions (FAQ)
What is the Difference Between HTML em Tag and HTML i tag?
What is the purpose of the <em> tag in HTML?
How does the <em> tag differ from the <strong> tag?
The <strong> tag indicates strong importance or urgency. It Suggests the text is critical or significant. The text is shown by browser as Bold
Can the <em> tag be nested, and what is the effect?
For example: <p>This is <em>very <em>important</em> information.</em></p>
In this case, "important" has a higher emphasis than "very."