Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 500235 of <em>

  • Revision slug: Web/HTML/Element/em
  • Revision title: <em>
  • Revision id: 500235
  • Created:
  • Creator: kscarfone
  • Is current revision? No
  • Comment

Revision Content

Summary

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

Usage Note: Typically this element is displayed in italic type. However, it should not be used simply to apply italic styling; use the CSS styling for that purpose. Use the {{HTMLElement("cite")}} element to mark the title of a work (book, play, song, etc.); it is also typically styled with italic type, but carries different meaning. Use the {{HTMLElement("strong")}} element to mark text that has greater importance than surrounding text.

Attributes

This element only includes the global attributes.

Example

The <em> element is often used to indicate an implicit or explicit contrast.

<p>
  In HTML 5, what was previously called <em>block-level</em> content is now called <em>flow</em> content.
</p>

Result

In HTML 5, what was previously called block-level content is now called flow content.

<i> vs. <em>

It is often confusing to new developers why there are so many elements to express emphasis on some text. <i> and <em> are perhaps one of the most common. Why use <em></em> vs <i></i>? They produce exactly the same result, right?

Not exactly. The visual result is, by default, the same - both tags render its content in italics. But the semantic meaning is different. The <em> tag represents stress emphasis of its contents, while the <i> tag represents text that is set off from the normal prose, such as the name of a movie or book, a foreign word, or when the text refers to the definition of a word instead of representing its semantic meaning.

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.

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".

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-em-element', '<em>')}} {{Spec2('HTML WHATWG')}}  
{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-em-element', '<em>')}} {{Spec2('HTML5 W3C')}}  
{{SpecName('HTML4.01', 'struct/text.html#h-9.2.1', '<em>')}} {{Spec2('HTML4.01')}}  

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}

See also

  • {{HTMLElement("i")}}
{{HTMLRef}}

Revision Source

<h2 id="Summary">Summary</h2>
<p>The <strong>HTML <code>&lt;em&gt;</code> element</strong> (or <em>HTML Emphasis Element</em>) marks text that has stress emphasis. The <code>&lt;em&gt;</code> element can be nested, with each level of nesting indicating a greater degree of emphasis.</p>
<div class="note">
 <strong>Usage Note:</strong> Typically this element is displayed in italic type. However, it should not be used simply to apply italic styling; use the CSS styling for that purpose. Use the {{HTMLElement("cite")}} element to mark the title of a work (book, play, song, etc.); it is also typically styled with italic type, but carries different meaning. Use the {{HTMLElement("strong")}} element to mark text that has greater importance than surrounding text.</div>
<ul class="htmlelt">
 <li><dfn><a href="/en-US/docs/Web/HTML/Content_categories">Content categories</a></dfn> <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">Flow content</a>, <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content">phrasing content</a>, palpable content</li>
 <li><dfn>Permitted content</dfn> <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content">Phrasing content</a>.</li>
 <li><dfn>Tag omission</dfn> {{no_tag_omission}}</li>
 <li><dfn>Permitted parent elements</dfn> Any element that accepts <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content">phrasing content</a>.</li>
 <li><dfn>DOM interface</dfn> {{domxref("HTMLElement")}} Up to Gecko 1.9.2 (Firefox 4) inclusive, Firefox implements the {{domxref("HTMLSpanElement")}} interface for this element.</li>
</ul>
<h2 id="Attributes">Attributes</h2>
<p>This element only includes the <a href="/en-US/docs/Web/HTML/Global_attributes">global attributes</a>.</p>
<h2 id="Example">Example</h2>
<p>The <code>&lt;em&gt;</code> element is often used to indicate an implicit or explicit contrast.</p>
<pre class="brush: html">
&lt;p&gt;
  In HTML 5, what was previously called &lt;em&gt;block-level&lt;/em&gt; content is now called &lt;em&gt;flow&lt;/em&gt; content.
&lt;/p&gt;</pre>
<h3 id="Result" name="Result">Result</h3>
<p>In HTML 5, what was previously called <em>block-level</em> content is now called <em>flow</em> content.</p>
<h2 id="&lt;i&gt;_vs._&lt;em&gt;">&lt;i&gt; vs. &lt;em&gt;</h2>
<p>It is often confusing to new developers why there are so many elements to express emphasis on some text. &lt;i&gt; and &lt;em&gt; are perhaps one of the most common. Why use <code>&lt;em&gt;&lt;/em&gt;</code> vs <code>&lt;i&gt;&lt;/i&gt;</code>? They produce exactly the same result, right?</p>
<p>Not exactly. The visual result is, by default, the same - both tags render its content in italics. But the semantic meaning is different. The <code>&lt;em&gt;</code> tag represents stress emphasis of its contents, while the &lt;i&gt; tag represents text that is set off from the normal prose, such as the name of a movie or book, a foreign word, or when the text refers to the definition of a word instead of representing its semantic meaning.</p>
<p>An example for <code>&lt;em&gt;</code> could be: "Just <em>do</em> it already!", or: "We <em>had</em> to do something about it". A person or software reading the text would pronounce the words in italics with an emphasis.</p>
<p>An example for <code>&lt;i&gt;</code> could be: "The
 <i>
  Queen Mary</i>
 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
 <i>
  Queen Mary</i>
 . Another example for <code>&lt;i&gt;</code> could be: "The word <em>the</em> is an article".</p>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-em-element', '&lt;em&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>&nbsp;</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-em-element', '&lt;em&gt;')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>&nbsp;</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML4.01', 'struct/text.html#h-9.2.1', '&lt;em&gt;')}}</td>
   <td>{{Spec2('HTML4.01')}}</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2>
<div>
 {{CompatibilityTable}}</div>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari (WebKit)</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>1.0</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Phone</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also" name="See_also">See also</h2>
<ul>
 <li>{{HTMLElement("i")}}</li>
</ul>
<div>
 {{HTMLRef}}</div>
Revert to this revision