The em Tag in HTML: How to Emphasize Text in HTML

html em tag

The HTML em tag shows stress or emphasis in text. It changes meaning for readers and screen readers.

What is the <em> Tag in HTML?

The <em> tag shows stress in content in HTML. It tells the browser to stress that part of the sentence.

The syntax looks like this:

<em>stressed text</em>

This tag changes how readers understand the sentence. It gives voice stress to the words inside it. Screen readers often use a different tone.

The tag changes tone. It tells which part to stress. That can change meaning.

You can nest one tag inside another. You can also use it many times in one paragraph. Each tag adds another level of stress.

You can style elements with CSS. The browser shows them in italics by default. You can change font, size, color, or other styles.

em {
  font-style: normal;
  color: red;
}

Valid Elements Inside <em> Tag in HTML

You can use only phrasing elements inside .

These work:

<em><a href="#">link</a></em>
<em><span>text</span></em>
<em><b>bold</b></em>

These do not work:

<em><div>block</div></em> <!-- invalid -->
<em><h1>heading</h1></em> <!-- invalid -->

Do not place block elements inside. That breaks HTML rules.

Examples

Basic Emphasis

<pre><code><p>I <em>need</em> this done today.</p></code></pre>

This shows that the word “need” is stressed.

Nested Emphasis

<pre><code><p>This is <em>very <em>urgent</em></em>.</p></code></pre>

This adds two levels of emphasis to the word “urgent”.

Styled Emphasis

<pre><code><style>
em {
  font-style: normal;
  color: blue;
}
</style>
<p>Read the <em>instructions</em> carefully.</p></code></pre>

This removes italics and changes the text color to blue.

Wrapping Up

In this article you learned what the HTML tag does and how it affects meaning. You also saw how to use it with other tags and CSS.

Here is a quick recap:

  • Use to stress words in a sentence.
  • Only use phrasing tags inside it.
  • Do not use block tags inside it.
  • Style it with CSS for control.

FAQs

What does do in HTML?

The <em> tag shows stress. Screen readers and browsers use this to change tone or show italics.

Can I put
inside ?

No. <div> is a block tag. <em> only accepts phrasing content.

Is the same as ?

No. <i> shows visual style. <em> adds meaning and stress.

How do I change style in HTML?

Use CSS. Wrap your code like this:
<style>
em {
  color: green;
  font-style: normal;
}
</style>

Similar Reads

HTML <cite> Tag: How to Reference Sources

The HTML <cite> tag is a small but important tool for marking up the title of a creative work. You…

HTML Elements and Tags: Elements vs Tags Explained

HTML builds web pages. It does this with elements and tags. Many new learners confuse them, so you need to…

HTML address Tag: Contact Information

The address tag in HTML shows contact details. The <address> tag helps show who owns the page or article. Understand…

HTML Document Structure Guide for Beginners

A web page must follow a clear structure so browsers can read and show it correctly. This guide helps you…

The canvas Tag in HTML: How to Draw Graphics with Examples

The HTML canvas tag draws shapes and images. It also helps you draw text with code. It gives control over…

HTML samp Tag: How to Show Sample Program Output

The HTML samp tag shows the result of a computer program or command. It helps readers know which text came…

HTML Breadcrumb Navigation Guide for Beginners

The breadcrumb in HTML shows a path through a site and marks the place of a page inside it. It…

How to Open Link in New Tab with HTML Target

This article shows you how to open a link in a new tab. Read the code and follow the examples…

HTML noscript Tag: How to Display Fallback When JS Is Disabled

The HTML noscript tag tells the browser what to show when JavaScript does not run. This tag targets users who…

HTML Syntax for Beginners: How it Works with Examples

HTML syntax shows how tags and attributes go together. It gives browsers the rules to read and display a page.…

Previous Article

HTML Article Tag: How to Create Semantic Content

Next Article

HTML strong Tag: How to Give Text Strong Importance

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *


Subscribe to Get Updates

Get the latest updates on Coding, Database, and Algorithms straight to your inbox.
No spam. Unsubscribe anytime.