The MathML <msup> element is used to attach a superscript to an expression.
It uses the following syntax: <msup> base superscript </msup>.
Attributes
class,id,style- Provided for use with stylesheets.
href- Used to set a hyperlink to a specified URI.
mathbackground- The background color. You can use
#rgb,#rrggbband HTML color names. mathcolor- The text color. You can use
#rgb,#rrggbband HTML color names. superscriptshift- The minimum space by which to shift the superscript up from the baseline of the expression, as a length value.
This attribute is deprecated and will be removed in the future.
Examples
Sample rendering: 
Rendering in your browser:
<math>
<msup>
<mi>X</mi>
<mn>2</mn>
</msup>
</math>
Specifications
| Specification | Status | Comment |
|---|---|---|
| MathML 3.0 The definition of 'msup' in that specification. |
Recommendation | Current specification |
| MathML 2.0 The definition of 'msup' in that specification. |
Recommendation | Initial specification |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
msup | Chrome No support No | Edge No support No | Firefox Full support 1 | IE No support No | Opera No support No | Safari Full support 6 | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 4 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
href | Chrome No support No | Edge No support No | Firefox Full support 7 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 7 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
mathbackground | Chrome No support No | Edge No support No | Firefox Full support 4 | IE No support No | Opera No support No | Safari Full support 6 | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 4 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
mathcolor | Chrome No support No | Edge No support No | Firefox Full support 4 | IE No support No | Opera No support No | Safari Full support 6 | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 4 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
superscriptshift | Chrome No support No | Edge No support No | Firefox Full support 1 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 4 | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support
See also
<msub>(Subscript)<msubsup>(Subscript-superscript pair)<mmultiscripts>(Prescripts and tensor indices)
