Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/mathml/element/msub/index.md
6540 views
---
title: <msub> slug: Web/MathML/Element/msub browser-compat: mathml.elements.msub
---

{{MathMLRef}}

The <msub> MathML element is used to attach a subscript to an expression.

It uses the following syntax: <msub> base subscript </msub>.

Attributes

This element's attributes include the global MathML attributes as well as the following deprecated attribute:

  • subscriptshift {{deprecated_inline}} {{Non-standard_Inline}}

    • : A <length-percentage> indicating the minimum amount to shift the baseline of the subscript down.

Note: For the subscriptshift attribute, some browsers may also accept legacy MathML lengths.

Examples

<math display="block"> <msub> <mi>X</mi> <mn>1</mn> </msub> </math>

{{ EmbedLiveSample('msub_example', 700, 200, "", "") }}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{ MathMLElement("msup") }} (Superscript)

  • {{ MathMLElement("msubsup") }} (Subscript-superscript pair)

  • {{ MathMLElement("mmultiscripts") }} (Prescripts and tensor indices)