<em>: The Emphasis element - HTML: HyperText Markup Language | MDN (2024)

The <em> HTML element marks text that has stress emphasis. The <em> element can be nested, with each level of nesting indicating a greater degree of emphasis.

Try it

Attributes

This element only includes the global attributes.

Usage notes

The <em> element is for words that have a stressed emphasis compared to surrounding text, which is often limited to a word or words of a sentence and affects the meaning of the sentence itself.

Typically this element is displayed in italic type. However, it should not be used to apply italic styling; use the CSS font-style property for that purpose. Use the <cite> element to mark the title of a work (book, play, song, etc.). Use the <i> element to mark text that is in an alternate tone or mood, which covers many common situations for italics such as scientific names or words in other languages. Use the <strong> element to mark text that has greater importance than surrounding text.

<i> vs. <em>

Some developers may be confused by how multiple elements seemingly produce similar visual results. <em> and <i> are a common example, since they both italicize text. What's the difference? Which should you use?

By default, the visual result is the same. However, the semantic meaning is different. The <em> element represents stress emphasis of its contents, while the <i> element represents text that is set off from the normal prose, such as a foreign word, fictional character thoughts, or when the text refers to the definition of a word instead of representing its semantic meaning. (The title of a work, such as the name of a book or movie, should use <cite>.)

This means the right one to use depends on the situation. Neither is for purely decorative purposes, that's what CSS styling is for.

An example for <em> could be: "Just do it already!", or: "We had to do something about it". A person or software reading the text would pronounce the words in italics with an emphasis, using verbal stress.

An example for <i> could be: "The Queen Mary sailed last night". Here, there is no added emphasis or importance on the word "Queen Mary". It is merely indicated that the object in question is not a queen named Mary, but a ship named Queen Mary. Another example for <i> could be: "The word the is an article".

Examples

In this example, the <em> element is used to highlight an implicit or explicit contrast between two ingredient lists:

html

<p> Ice cream is made with milk, sweetener, and cream. Frozen custard, on the other hand, is made of milk, cream, sweetener, and <em>egg yolks</em>.</p>

Result

Technical summary

Content categories Flow content, phrasing content, palpable content.
Permitted content Phrasing content.
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts phrasing content.
Implicit ARIA role emphasis
Permitted ARIA roles Any
DOM interface HTMLElement Up to Gecko 1.9.2 (Firefox 4) inclusive, Firefox implements the HTMLSpanElement interface for this element.

Specifications

Specification
HTML Standard
# the-em-element

Browser compatibility

BCD tables only load in the browser

See also

<em>: The Emphasis element - HTML: HyperText Markup Language | MDN (2024)

FAQs

<em>: The Emphasis element - HTML: HyperText Markup Language | MDN? ›

<em>: The Emphasis element. The <em> HTML element marks text that has stress emphasis. The <em> element can be nested, with each level of nesting indicating a greater degree of emphasis.

What is the em element in HTML? ›

The <em> tag is used to define emphasized text. The content inside is typically displayed in italic. A screen reader will pronounce the words in <em> with an emphasis, using verbal stress.

What is the EM and the strong element? ›

It doesn't imply any specific visual effect on the text, but browsers use italic to represent it by default. Overall, strong is used to provide strong importance, while em is used to provide a mild emphasis.

What is the difference between I and EM in HTML? ›

The <em> tag is used to draw the reader's attention to the text and suggests that the enclosed text should be spoken with a higher pitch and with a slightly drawn out and more emphasized voice compared to a regular sentence. The <i> tag, on the other hand, is used to render text in an italicized font.

What does HyperText markup language mean in HTML? ›

HyperText Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript.

How do I add an emphasis element? ›

<strong> and <em>

You use these elements pretty much the same way you would have used bold and italics in the past. Simply surround your text with the opening and closing tags (<em> and </em> for emphasis and <strong> and </strong> for strong emphasis) and the enclosed text will be emphasized.

What is em value in HTML? ›

The em is simply the font size. In an element with a 2in font, 1em thus means 2in. Expressing sizes, such as margins and paddings, in em means they are related to the font size, and if the user has a big font (e.g., on a big screen) or a small font (e.g., on a handheld device), the sizes will be in proportion.

What are the elements of EM? ›

The em element represents stress emphasis of its contents. The level of emphasis that a particular piece of content has is given by its number of ancestor em elements. The placement of emphasis changes the meaning of the sentence. The element thus forms an integral part of the content.

What is strong element used for? ›

<strong>: The Strong Importance element. The <strong> HTML element indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type.

What is strong vs B element? ›

Unlike the <b> tag, which is primarily used for stylistic purposes to apply bold formatting, the <strong> tag carries semantic meaning. While browsers typically render text within <strong> tags in a bold font, the primary purpose of the tag is to provide additional context about the significance of the enclosed text.

What is an emphasized text? ›

In typography, emphasis is the strengthening of words in a text with a font in a different style from the rest of the text, to highlight them. It is the equivalent of prosody stress in speech.

Should I use PX or em in HTML? ›

Use px when you want the size to be fixed. Use rem/em when you want it to be adaptive to the scale of the system. For example, fonts using px wont re-scale if you change font size of the system. If you use rem or em their size will change which adds accessability for people that have harder to read.

What is em in website design? ›

An em in CSS is a scalable unit of measurement that defines the size of an element relative to its parent's font size. Unlike absolute units such as pixels (px) or points (pt), an em dynamically adapts its size based on the context.

What are the five uses of HTML? ›

What is HTML used for?
  • Structuring web pages. With tags and elements, we can define the headings, paragraphs, and other contents of a web page. ...
  • Navigating the internet. ...
  • Embedding images and videos. ...
  • Improving client-side data storage and offline capabilities. ...
  • Game development. ...
  • Interacting with native APIs.

What is the difference between HTML elements and tags? ›

Jennifer Kyrnin is a professional web developer who assists others in learning web design, HTML, CSS, and XML. An HTML tag is an indication to a web browser of how a web page should displayed, but an HTML element is an individual component of HTML. HTML elements are created using HTML tags.

Which element contains the document title? ›

The <title> HTML element defines the document's title that is shown in a browser's title bar or a page's tab. It only contains text; tags within the element are ignored.

What is 1.5 em in HTML? ›

The size of an EM or percent depends on its parent. If the text size of body is 16 pixels, then 150% or 1.5 EM will be 24 pixels (1.5 * 16).

What is em dash in HTML? ›

The em-dash is often typed as a double hyphen in copy. In printed material, use an em-dash—which has no space on either side. University typographical standards are to add a little “air” on either side of the dash, but not a full space. In web copy, use the HTML character entity <code>&#8212;</code>.

How do I create an em rule in HTML? ›

How to Enter the Hyphen, En Dash and Em Dash in HTML and Word
  1. A hyphen is the smallest dash available. ...
  2. An en dash is slightly longer than a hyphen. ...
  3. Which brings us to the em dash. ...
  4. The html codes for the en dash are &ndash; or &#8211;
  5. Html codes for the em dash are &mdash; or &#8212;

Is em a block element in HTML? ›

Examples of inline elements: <a> <strong> , <em> , <b> , <i> , <q>, <mark>

Top Articles
Latest Posts
Article information

Author: Pres. Carey Rath

Last Updated:

Views: 6492

Rating: 4 / 5 (41 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Pres. Carey Rath

Birthday: 1997-03-06

Address: 14955 Ledner Trail, East Rodrickfort, NE 85127-8369

Phone: +18682428114917

Job: National Technology Representative

Hobby: Sand art, Drama, Web surfing, Cycling, Brazilian jiu-jitsu, Leather crafting, Creative writing

Introduction: My name is Pres. Carey Rath, I am a faithful, funny, vast, joyous, lively, brave, glamorous person who loves writing and wants to share my knowledge and understanding with you.