The MathML <msub> element is used to attach a subscript to an expression.
It uses the following syntax: <msub> base subscript </msub>.
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. subscriptshift- The minimum space by which to shift the subscript below 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>
<msub>
<mi>X</mi>
<mn>1</mn>
</msub>
</math>
Specifications
| Specification | Status | Comment |
|---|---|---|
| MathML 3.0 The definition of 'msub' in that specification. |
Recommendation | Current specification |
| MathML 2.0 The definition of 'msub' 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 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
msub | 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 |
subscriptshift | 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
<msup>(Superscript)<msubsup>(Subscript-superscript pair)<mmultiscripts>(Prescripts and tensor indices)
