<mo>
Baseline 2023
Newly available
Since January 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The <mo>
MathML element represents an operator in a broad sense. Besides operators in strict mathematical meaning, this element also includes "operators" like parentheses, separators like comma and semicolon, or "absolute value" bars.
Attributes
In addition to the global MathML attributes, this element accepts the following attributes whose default values depend on the operator's form and content:
accent
Non-standard-
A
<boolean>
indicating whether the operator should be treated as an accent when used as an under- or overscript (i.e. drawn bigger and closer to the base expression). fence
-
A
<boolean>
indicating whether the operator is a fence (such as parentheses). There is no visual effect for this attribute. form
-
An enumerated attribute specifying how the operator is to be presented. For example, depending on the value, a different amount of space might be rendered on either side of the operator. It can have one of the following values:
prefix
: The operator appears before its operands. For example, in the expression+ a
, the+
is a prefix operator.infix
: The operator appears between its operands. In the expressiona + b
, the+
is an infix operator.postfix
: The operator appears after its operands. For example, in the expressiona +
, the+
is a postfix operator.
largeop
-
A
<boolean>
indicating whether the operator should be drawn bigger whenmath-style
is set tonormal
. lspace
-
A
<length-percentage>
indicating the amount of space before the operator. maxsize
-
A
<length-percentage>
indicating the maximum size of the operator when it is stretchy. minsize
-
A
<length-percentage>
indicating the minimum size of the operator when it is stretchy. movablelimits
-
A
<boolean>
indicating whether attached under- and overscripts move to sub- and superscript positions whenmath-style
is set tocompact
. rspace
-
A
<length-percentage>
indicating the amount of space after the operator. separator
-
A
<boolean>
indicating whether the operator is a separator (such as commas). There is no visual effect for this attribute. stretchy
-
A
<boolean>
indicating whether the operator stretches to the size of the adjacent element. symmetric
-
A
<boolean>
indicating whether a stretchy operator should be vertically symmetric around the imaginary math axis (centered fraction line).
Note:
For the lspace
, maxsize
, minsize
and rspace
attributes, some browsers may also accept legacy MathML lengths.
Examples
<math display="block">
<mrow>
<mn>5</mn>
<mo>+</mo>
<mn>5</mn>
</mrow>
</math>
<math display="block">
<mrow>
<mo>[</mo> <!-- default form value: prefix -->
<mrow>
<mn>0</mn>
<mo>;</mo> <!-- default form value: infix -->
<mn>1</mn>
</mrow>
<mo>)</mo> <!-- default form value: postfix -->
</mrow>
</math>
Technical summary
Implicit ARIA role | None |
---|
Specifications
Specification |
---|
MathML Core # operator-fence-separator-or-accent-mo |
Browser compatibility
BCD tables only load in the browser