HTML <em> tagS2C Home   « HTML <em> tag

Definition

The <em> tag is used to stress emphasis of its contents.

Use the <strong> tag to mark text with strong importance.

If you just want to embolden some text with no significance use the <b> tag or use the CSS font-weight property for finer-grained control.

Example


<p>Normal text. <em>This text will be emphasised!!</em Normal text. ></p>

Normal text. This text will be emphasized!! Normal text.

Attributes

The following attributes can be used with the <em> tag.


<em> Specific Attributes
Attribute Value Description Example
There are no required or optional attributes specific to the <em> tag.
<em> Global Attributes
Attribute Description Example
Common
classSpecifies a classname for the element allowing you to apply the style of the predefined class to the content.

<em class="name">Emphasised Text</em>
idSpecifies a unique id for the element allowing you to apply the style of the predefined id to the content.

<em id="name">Emphasised Text</em>
styleSpecifies an inline style for the element allowing you to apply the style to the contentt.

<em style="color:red;">Emphasised Text</em>
titleSpecifies an inline style for the element allowing you to apply the style to the content.

<em title="Content info">Emphasised Text</em>
Keyboard
accesskeySpecifies a keyboard shortcut to associate with the element.

<em accesskey="a">Emphasised Text</em>
tabindexSpecifies a tab order for the element.

<em tabindex="1">Emphasised Text</em>
Language
dirSpecifies the directional flow of the content.

<!-- The text will flow from left to right -->
<em dir="ltr">Emphasised Text</em>
<!-- The text will flow from right to left -->
<em dir="rtl">Emphasised Text</em>
langSpecifies a language code for the content of the element.

<em lang="en">Emphasised Text</em>
spellcheckSpecifies an inline style for the element allowing you to apply the style to the contentt.

<!-- Valid values true and false. -->
<!-- Default inherited / browser specific. -->
<em spellcheck="true">Emphasised Text</em> 
translateSpecifies an inline style for the element allowing you to apply the style to the content.

<!-- Valid values yes and no. -->
<!-- Default yes. -->
<em translate="no">Emphasised Text</em> 
Miscellaneous
contenteditableSpecifies whether the content of the element is editable.

<!-- Valid values true and false. -->
<!-- Default inherited. -->
<em contenteditable="true">Emphasised Text</em> 
draggableSpecifies whether the element is draggable.

<!-- Valid values true and false. -->
<!-- Default browser specific. -->
<em draggable="true">Emphasised Text</em>
hiddenSpecifies whether the element is not yet, or no longer, relevant.

<!-- Valid values an empty string or hidden -->
<em hidden>Emphasised Text</em> 
<em hidden="hidden">Emphasised Text</em> 
<em> Event Attributes
Attribute Description Example
Document Element
oncopyThe script to be run when the user copies the content of an element.

 <!-- Executes go() function -->
<em oncopy="go()">Emphasised Text</em> 
oncutThe script to be run when the user cuts the content of an element.

 <!-- Executes go() function -->
<em oncut="go()">Emphasised Text</em>
onpasteThe script to be run when the user pastes some content into an element.

 <!-- Executes go() function -->
<em onpaste="go()">Emphasised Text</em>
Drag and Drop
ondragThe script to be run when an element is dragged.

 <!-- Executes go() function -->
<em ondrag="go()">Emphasised Text</em>
ondragendThe script to be run when an element has stopped being dragged.

 <!-- Executes go() function -->
<em ondragend="go()">Emphasised Text</em>
ondragenterThe script to be run when an element has been dragged to a valid drop target.

 <!-- Executes go() function -->
<em ondragenter="go()">Emphasised Text</em>
ondragleaveThe script to be run when an element leaves a valid drop target.

 <!-- Executes go() function -->
<em ondragleave="go()">Emphasised Text</em>
ondragoverThe script to be run when an element is being dragged over a valid drop target.

 <!-- Executes go() function -->
<em ondragover="go()">Emphasised Text</em>
ondragstartThe script to be run at the start of a drag operation.

 <!-- Executes go() function -->
<em ondragstart="go()">Emphasised Text</em>
ondropThe script to be run when a dragged element is being dropped.

 <!-- Executes go() function -->
<em ondrop="go()">Emphasised Text</em>
Form
onblurThe script to be run when the element loses focus.

 <!-- Executes go() function -->
<em onblur="go()">Emphasised Text</em>
onchangeThe script to be run when object changed and attempt to leave field.

 <!-- Executes go() function -->
<em onchange="go()">Emphasised Text</em>
oncontextmenuThe script to be run when a context menu is triggered.

 <!-- Executes go() function -->
<em oncontextmenu="go()">Emphasised Text</em>
onfocusThe script to be run when the element gets focus.

 <!-- Executes go() function -->
<em onfocus="go()">Emphasised Text</em>
oninputThe script to be run when an element gets user input.

 <!-- Executes go() function -->
<em oninput="go()">Emphasised Text</em>
oninvalidThe script to be run when an element is invalid.

 <!-- Executes go() function -->
<em oninvalid="go()">Emphasised Text</em>
onresetThe script to be run when a dragged element is being dropped.

 <!-- Executes go() function -->
<em onreset="go()">Emphasised Text</em>
onselectThe script to be run when some or all of the contents of an object are selected.

 <!-- Executes go() function -->
<em onselect="go()">Emphasised Text</em>
onsubmitThe script to be run when a form is submitted.

 <!-- Executes go() function -->
<em onsubmit="go()">Emphasised Text</em>
Keyboard
onkeydownThe script to be run when an element is in focus and keyboard key is pressed down.

 <!-- Executes go() function -->
<em onkeydown="go()">Emphasised Text</em>
onkeypressThe script to be run when an element is in focus and keyboard key is pressed down and released.

 <!-- Executes go() function -->
<em onkeypress="go()">Emphasised Text</em>
onkeyupThe script to be run when an element is in focus and keyboard key is released.

 <!-- Executes go() function -->
<em onkeyup="go()">Emphasised Text</em>
Media
onabortThe script code to be run on abort.

 <!-- Executes go() function -->
<em onabort="go()">Emphasised Text</em>
oncanplayThe script to be run when a file has buffered enough so it is ready to start playing.

 <!-- Executes go() function -->
<em oncanplay="go()">Emphasised Text</em>
oncanplaythroughThe script to be run when a file can be played all the way to the end without further need of buffering.

 <!-- Executes go() function -->
<em oncanplaythrough="go()">Emphasised Text</em>
oncuechangeThe script to be run when the cue changes when using the track element.

 <!-- Executes go() function -->
<em oncuechange="go()">Emphasised Text</em>
ondurationchangeThe script to be run when the length of the media is changed.

 <!-- Executes go() function -->
<em ondurationchange="go()">Emphasised Text</em>
onemptiedThe script to be run when a media resource element suddenly becomes empty, usually due to an error.

 <!-- Executes go() function -->
<em onemptied="go()">Emphasised Text</em>
onendedThe script to be run when the media has reach the end.

 <!-- Executes go() function -->
<em onended="go()">Emphasised Text</em>
onloadeddataThe script to be run when media data is loaded and playback can start.

 <!-- Executes go() function -->
<em onloadeddata="go()">Emphasised Text</em>
onloadedmetadataThe script to be run when metadata has been loaded.

 <!-- Executes go() function -->
<em onloadedmetadata="go()">Emphasised Text</em>
onloadstartThe script to be run whenthe media resource has started loading.

 <!-- Executes go() function -->
<em onloadstart="go()">Emphasised Text</em>
onpauseThe script to be run when the media resource has been paused.

 <!-- Executes go() function -->
<em onpause="go()">Emphasised Text</em>
onplayThe script to be run when the media resource starts playback.

 <!-- Executes go() function -->
<em onplay="go()">Emphasised Text</em>
onplayingThe script to be run when when playback has already begun.

 <!-- Executes go() function -->
<em onplaying="go()">Emphasised Text</em>
onprogressThe script to be run when the browser is fetching the media data.

 <!-- Executes go() function -->
<em onprogress="go()">Emphasised Text</em>
onratechangeThe script to be run when the playback rate changes.

 <!-- Executes go() function -->
<em onratechange="go()">Emphasised Text</em>
onseekedThe script to be run when the seeking attribute is set to false indicating that seeking has finished.

 <!-- Executes go() function -->
<em onseeked="go()">Emphasised Text</em>
onseekingThe script to be run when the seeking attribute is set to true indicating that seeking is currently active.

 <!-- Executes go() function -->
<em onseeking="go()">Emphasised Text</em>
onstalledThe script to be run when the browser is unable to continue fetching media data.

 <!-- Executes go() function -->
<em onstalled="go()">Emphasised Text</em>
onsuspendThe script to be run when media data has stopped before being completely loaded.

 <!-- Executes go() function -->
<em onsuspend="go()">Emphasised Text</em>
ontimeupdateThe script to be run when the media resources current playback position has changed.

 <!-- Executes go() function -->
<em ontimeupdate="go()">Emphasised Text</em>
onvolumechangeThe script to be run when the volume has changed or been muted.

 <!-- Executes go() function -->
<em onvolumechange="go()">Emphasised Text</em>
onwaitingThe script to be run when the media resource has paused but is expected to resume.

 <!-- Executes go() function -->
<em onwaiting="go()">Emphasised Text</em>
Mouse
onclickThe script to be run when when a mouse is clicked on an element.

 <!-- Executes go() function -->
<em onclick="go()">Emphasised Text</em>
ondblclickThe script to be run when a mouse is double clicked on an element.

 <!-- Executes go() function -->
<em ondblclick="go()">Emphasised Text</em>
onmousedownThe script to be run when he mouse button is pressed down while the cursor is over an element.

 <!-- Executes go() function -->
<em onmousedown="go()">Emphasised Text</em>
onmousemoveThe script to be run when the mouse button is moved.

 <!-- Executes go() function -->
<em onmousemove="go()">Emphasised Text</em>
onmouseoutThe script to be run when the mouse cursor moves off an element.

 <!-- Executes go() function -->
<em onmouseout="go()">Emphasised Text</em>
onmouseoverThe script to be run when the mouse cursor moves over an element.

 <!-- Executes go() function -->
<em onmouseover="go()">Emphasised Text</em>
onmouseupThe script to be run when the mouse button is released while the cursor is over the element.

 <!-- Executes go() function -->
<em onmouseup="go()">Emphasised Text</em>
onwheelThe script to be run when the mouse wheel rolls up or down over an element.

 <!-- Executes go() function -->
<em onwheel="go()">Emphasised Text</em>
Scroll
onscrollThe script code to be run when the scrollbar of an element is being scrolled.

 <!-- Executes go() function -->
<em onscroll="go()">Emphasised Text</em> 
Window - NONE

Relevant HTML Tutorials

HTML Basics - Inline Semantics