HTML <i> tagS2C Home   « HTML <i> tag

Definition

The <i> tag is used to define a change of mood or alternate voice in text and can also be used for technical terms, phrases from other language or thoughts and meanderings.

The <i> tag should not be used for italics from HTML5 onwards as was the case in earlier versions of HTML, even though it will generally be rendered in italics in browsers

Use css attributes such as the CSS font-style property for styling text.

Use the <em> tag for emphasizing text.

Use the <strong> tag to add importance to text.

Example


<p>The best known magic word is <i>abracadabra</i> and is used by magicians of all ages.</p>

The best known magic word is abracadabra and is used by magicians of all ages.

Required Attributes

NONE

Optional Attributes

NONE

Attributes

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


<i> Specific Attributes
Attribute Value Description Example
There are no required or optional attributes specific to the <i> tag.
<i> 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.

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

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

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

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

<i accesskey="a">Inflection Text</i>
tabindexSpecifies a tab order for the element.

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

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

<i lang="en">Inflection Text</i>
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. -->
<i spellcheck="true">Inflection Text</i> 
translateSpecifies an inline style for the element allowing you to apply the style to the content.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

 <!-- Executes go() function -->
<i oncanplay="go()">Inflection Text</i>
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 -->
<i oncanplaythrough="go()">Inflection Text</i>
oncuechangeThe script to be run when the cue changes when using the track element.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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