我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译
您也可以阅读此文章的English (US)版。

The MathML <mo> 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

accent
If the operator is used as an under- or overscript this attribute specifies whether the operator should be treated as an accent.
Allowed values are true or false.
class, id, style
Provided for use with stylesheets.
dir
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
fence
There is no visual effect for this attribute, but it specifies whether the operator is a fence (such as parentheses).
Allowed values are true or false.
form
Specifies the role of the operator in an enclosed expression, which affects spacing and other default properties. For ordinary operators (+, -, etc. ) you usually do not need to specify this attribute explicitly.
Possible values are:
  • prefix, for opening fences. (It is the default value if the operator is the first argument in a <mrow> element with more than one argument.)
  • infix, for separators. (It is the default value if the operator is not included in a <mrow> element.)
  • postfix, closing fences. (It is the default value if the operator is the last argument in a <mrow> element with more than one argument.)
href
Used to set a hyperlink to a specified URI.
largeop
Specifies whether the operator should be drawn larger than normal when displaystyle="true" is set. Allowed values are either true or false.
lspace
The amount of space before the operator (see length for values and units). The constant thickmathspace (5/18em) is the default value.
mathbackground
The background color. You can use #rgb, #rrggbb and HTML color names.
mathcolor
The text color. You can use #rgb, #rrggbb and HTML color names.
mathsize
The size of the content. Possible values are:
  • small: Font is rendered smaller than the current font size.
  • normal: Equivalent to 100% or 1em.
  • big: Font is rendered larger than the current font size.
  • a custom length.
  • or a unitless value which multiplies the default.
mathvariant
This attribute specifies the logical class of the operator which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed:
  • normal (Default value) ; Example
  • bold ; Example
  • italic ; Example
  • bold-italic ; Example
  • double-struck ; Example
  • bold-fraktur ; Example
  • script ; Example
  • bold-script ; Example
  • fraktur ; Example
  • sans-serif ; Example
  • bold-sans-serif ; Example
  • sans-serif-italic ; Example
  • sans-serif-bold-italic ; Example
  • monospace ; Example
  • initial ; مثال
  • tailed ; مثال
  • looped ; مثال
  • stretched ; مثال
maxsize
If stretchy is true, this attribute specifies the maximum size of the operator. Allowed values are:
  • infinity
  • an arbitrary length
minsize
If stretchy is true, this attribute specifies the minimum size of the operator. Allowed values are:
  • infinity
  • an arbitrary length
movablelimits
Specifies whether attached under- and overscripts move to sub- and superscript positions when displaystyle is false.
Allowed values are either true or false.
rspace
The amount of space after the operator (see length for values and units). The constant thickmathspace (5/18em) is the default value.
separator
There is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas).
Allowed values are true or false.
stretchy
Specifies whether the operator stretches to the size of the adjacent element.
Allowed values are true or false.
symmetric
If stretchy is true, this attribute specifies whether the operator should be vertically symmetric around the imaginary math axis (centered fraction line).
The default value is true if stretchy is set to true and otherwise false. Allowed values are true or false.

Examples

<math>

<mrow>
  <mn>5</mn>
  <mo>+</mo>
  <mn>5</mn>
</mrow> 

<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>

Specifications

Specification Status Comment
MathML 3.0
The definition of 'mo' in that specification.
Recommendation Current specification
MathML 2.0
The definition of 'mo' in that specification.
Recommendation Initial specification

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support 6WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
accentChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
dirChrome No support NoEdge ? Firefox Full support 12IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 14Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
formChrome No support NoEdge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
hrefChrome No support NoEdge ? Firefox Full support 7IE No support NoOpera No support NoSafari Full support 10WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 7Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
largeopChrome No support NoEdge ? Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android ?
lspaceChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support YesWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
rspaceChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support YesWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
mathsizeChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari Full support 6WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
mathvariantChrome No support NoEdge ? Firefox Full support 28IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 28Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
maxsizeChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
minsizeChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
moveablelimitsChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
stretchyChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS Full support 6Samsung Internet Android ?
symmetricChrome No support NoEdge ? Firefox Full support 1IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

Gecko-specific notes

  • Starting with Gecko 16.0 (Firefox 16.0 / Thunderbird 16.0 / SeaMonkey 2.13) the default values for lspace and rspace have been corrected to match the MathML3 specification. They now default to the constant thickmathspace (5/18em).
  • Starting with Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) a unitless value for mathsize is allowed.
  • Some mathvariant values are only implemented starting with Gecko 28.0 (Firefox 28.0 / Thunderbird 28.0 / SeaMonkey 2.25) and require appropriate math fonts.
  • Any linebreaking or indentation attributes are not implemented yet. See bug 534962.

文档标签和贡献者

此页面的贡献者: fscholz, Draussenduscher, fred.wang, Sheppy, jswisher
最后编辑者: fscholz,