HTML <sup> tag (presentational)S2C Home   « HTML <sup> tag

Definition

The <sup> tag is used for defining superscript text.

Use the CSS vertical-align property for more control.

Example


<sup>This text will be appear higher on the line than normal text.</sup>

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.


<sup class="classname">Superscript text here</sup>

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


<sup id="idname">Superscript text here</sup>

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


<sup style="color:red;text-align:left">Superscript text here</sup>

title - specifies extra information about the content.


<sup title="information about the content">Superscript text here</sup>

Language Attributes

dir - specifies the directional flow of the content.


<!-- The text will flow from left to right -->
<sup dir="ltr">Superscript text here</sup>

<!-- The text will flow from right to left -->
<sup dir="rtl">Superscript text here</sup>

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


<sup lang="en">Superscript text here</sup>

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


<sup xml:lang="fr">Superscript text here</sup>

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 -->
<sup onkeydown="go()">Superscript text here</sup>

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 -->
<sup onkeypress="go()">Superscript text here</sup>

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


<!-- Executes the go() function -->
<sup onkeyup="go()">Superscript text here</sup>

Mouse Event Attributes

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


<!-- Executes the go() function -->
<sup onclick="go()">Superscript text here</sup>

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


<!-- Executes the go() function -->
<sup ondblclick="go()">Superscript text heren</sup>

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 -->
<sup onmousedown="go()">Superscript text here</sup>

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


<!-- Executes the go() function -->
<sup onmousemove="go()">Superscript text here</sup>

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


<!-- Executes the go() function -->
<sup onmouseout="go()">Superscript text here</sup>

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


<!-- Executes the go() function -->
<sup onmouseover="go()">Superscript text here</sup>

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


<!-- Executes the go() function -->
<sup onmouseup="go()">Superscript text here</sup>

go to home page Homepage go to top of page Top