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

Definition

The <em> tag is used to emphasise our content.

Example


<em>This text will be emphasised.</em>

Required Attributes

NONE

Optional Attributes

NONE

Common Attributes

class - specifies a classname for the element allowing you to apply the style of the predefined class to the content.


<em class="classname">Text to emphasise here</em>

id - specifies a unique id for the element allowing you to apply the style of the predefined id to the content.


<em id="idname">Text to emphasise here</em>

style - specifies an inline style for the element allowing you to apply the style to the content.


<em style="color:red;text-align:left">Text to emphasise here</em>

title - specifies extra information about the content.


<em title="information about the content">Text to emphasise here</em>

Language Attributes

dir - specifies the directional flow of the content.


<!-- The text will flow from left to right -->
<em dir="ltr">Text to emphasise here</em>

<!-- The text will flow from right to left -->
<em dir="rtl">Text to emphasise here</em>

lang - specifies a language code for the content of the element.


<em lang="en">Text to emphasise here</em>

xml:lang - specifies a language code for the content of the element in XHTML documents.


<em xml:lang="fr">Text to emphasise here</em>

Document Event Attributes

NONE

Form Event Attributes

NONE

Image Event Attributes

NONE

Keyboard Event Attributes

onkeydown - The JavaScript code to be run when an element is in focus and keyboard key is pressed.


<!-- Executes the go() function -->
<em onkeydown="go()">Text to emphasise here</em>

onkeypress - The JavaScript code to be run when an element is in focus and keyboard key is pressed down and released.


<!-- Executes the go() function -->
<em onkeypress="go()">Text to emphasise here</em>

onkeyup - The JavaScript code to be run when an element is in focus and keyboard key is released.


<!-- Executes the go() function -->
<em onkeyup="go()">Text to emphasise here</em>

Mouse Event Attributes

onclick - The JavaScript code to be run when a mouse is clicked on the element.


<!-- Executes the go() function -->
<em onclick="go()">Text to emphasise here</em>

ondblclick - The JavaScript code to be run when a mouse is double clicked on the element.


<!-- Executes the go() function -->
<em ondblclick="go()">Text to emphasise here</em>

onmousedown - The JavaScript code to be run when the mouse button is pressed down while the cursor is over the element.


<!-- Executes the go() function -->
<em onmousedown="go()">Text to emphasise here</em>

onmousemove - The JavaScript code to be run when the mouse button is moved.


<!-- Executes the go() function -->
<em onmousemove="go()">Text to emphasise here</em>

onmouseout - The JavaScript code to be run when the mouse cursor moves off an element.


<!-- Executes the go() function -->
<em onmouseout="go()">Text to emphasise here</em>

onmouseover - The JavaScript code to be run when the mouse cursor moves over an element.


<!-- Executes the go() function -->
<em onmouseover="go()">Text to emphasise here</em>

onmouseup - The JavaScript code to be run when the mouse button is released while the cursor is over the element.


<!-- Executes the go() function -->
<em onmouseup="go()">Text to emphasise here</em>

go to home page Homepage go to top of page Top