sub element

If you don't know what an element is or how you must use it, I recommend you read the "HTML tags and attributes" tutorial that you can find in the HTML tutorials section.

Description

The sup element represents a superscript.

Authors must refrain from using this element merely for presentational purposes. The meaning of the document should be altered if the element is removed.

Although this element is useful for small formulas, authors are encouraged to use the more appropriate MathML, to mark up mathematical expressions.

Examples

The following example shows a very famous formula in a sentence. The sup element is being used to mark up the exponent inside the formula, while var is properly wrapping the variables.

<p>It's going to be a key moment in history, like when Albert Einstein presented his formula <var>E</var>=<var>m</var><var>c</var><sup>2</sup>.</p>

It's going to be a key moment in history, like when Albert Einstein presented his formula E=mc2.

The next example shows another mathematical expression where the sup element is wrapping the exponent.

<p>Do you think the number 5000<sup>-1</sup> is grater than 1?</p>

Do you think the number 5000-1 is grater than 1?

Attributes

Global attributes

For information about global attributes refer to this list of global attributes in HTML5.

Events

Global events

For information about global events refer to this list of global events in HTML5.