HTML/Elements/em

From Web Education Community Group
< HTML‎ | Elements
Jump to: navigation, search

<em>

The <em> element represents stress emphasis of its contents.

Point

  • The placement of emphasis changes the meaning of the sentence.
  • The level of emphasis that a particular piece of content has is given by its number of ancestor em elements. [Example D]


HTML Attributes

See global attributes.


Examples

Example A

By emphasizing the first word, the statement implies that the kind of animal under discussion is in question [try it]:

<p><em>Cats</em> are cute animals.</p>

Em01.png

Example B

By moving it to the adjective, the exact nature of the cats is reasserted [try it]:

<p>Cats are <em>cute</em> animals.<p>

Em02.png

Example C

By emphasizing the entire sentence, it becomes clear that the speaker is fighting hard to get the point across. This kind of emphasis also typically affects the punctuation, hence the exclamation mark here [try it]:

<p><em>Cats are cute animals.</em></p>

Em03.png

Example D

The following examples are the methods of emphasizing loveliness more [try it]:

<p><em>Cats are  <em>cute</em> animals.</em></p>

Em04.png

Example of bad usage

The em element also isn't intended to convey importance; for that purpose, the strong element is more appropriate.

<!-- do not copy this example, it is an example of bad usage! -->
<p><em>Warning.</em> This dungeon is dangerous.</p>

Example of good usage:

<p><strong>Warning.</strong> This dungeon is dangerous.</p>


HTML Reference

The HTML5 specification defines the <em> element in 4.6.2 The em element.