em element

If you don't know what an element is or how you must use it, I recommend you read the "HTML tags and attributes" tutorial that you can find in the HTML tutorials section.

Description

The em element represents text with stress emphasis. The position of this element in a sentence and the words it's wrapping are important for the interpretation of its meaning.

The em element provides emphasis to the text it wraps. When there's need to simply stand out a piece of text as if it was in a different mood or voice, the i element should be used instead.

The em element doesn't convey importance to its contents. To give importance to a piece of text use the strong element.

Examples

The following example shows the em element being used in different ways in one same sentence, with the purpose of demonstrating how its position and the text it encloses can change the meaning it conveys to the whole sentence.

<p>It <em>is</em> a rainy day.</p>
<p>It is a <em>rainy</em> day.</p>
<p>It is a rainy <em>day</em>.</p>
<p><em>It is a rainy day!</em></p>

It is a rainy day.

It is a rainy day.

It is a rainy day.

It is a rainy day!

In the first three examples the author is reaffirming some aspect of the same declaration:

  1. The rain is actually puring, as if someone has called into doubt this assertion.
  2. The day is rainy, as if someone has suggested it was sunny or something else.
  3. It's day time, as if someone supposed it could be night time.

In the final sentence, the emphasis is being applied to the whole text, evidencing the author's striving to make the point clear. This struggle is usually the reason why the sentence is accompanied by an exclamation mark.

Attributes

Global attributes

For information about global attributes refer to this list of global attributes in HTML5.

Events

Global events

For information about global events refer to this list of global events in HTML5.

X

Are you looking for a place to host your next website? I can help you with that!