HTML <sup> tagS2C Home   « HTML <sup> tag

Definition

The <sup> tag is used for defining Superscript Text.

Use the CSS vertical-align property for more control.

Example


<p>Some normal text <sup>This text appears higher on the line than normal text.</sup> More normal text.</p>

Some normal text This text appears higher on the line than normal text. More normal text.

Attributes

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


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

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

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

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

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

<sup accesskey="a">Superscript Text</sup>
tabindexSpecifies a tab order for the element.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Relevant HTML Tutorials

HTML Intermediate - More Text Tags