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

* Some parts of this feature may have varying levels of support.

<mo> MathML 元素表示广义上的运算符。除了严格数学意义上的运算符外,该元素还包括像括号、分隔符(如,逗号和分号)或“绝对值”符号这一类的“运算符”。

属性

除了全局 MathML 属性外,该元素接受以下属性(其默认值取决于运算符的形式和内容):

accent 非标准

一个 <boolean>,表示运算符在被用作下标上标时是否应该被着重标识(即被放大并靠近基础表达式)。

fence

一个 <boolean>,表示运算符是否是围栏(例如括号)。该属性没有视觉效果。

largeop

一个 <boolean>,表示当 math-style设置为 normal 时是否应该放大运算符。

lspace

一个 <length-percentage>,表示运算符前的空间量。

maxsize

一个 <length-percentage>,表示运算符在可拉伸时的最大大小。

minsize

一个 <length-percentage>,表示运算符在可拉伸时的最小大小。

movablelimits

一个 <boolean>,表示附加的下标和上标在 math-style 设置为 compact 时是否需要移动到上下角标的位置。

rspace

一个 <length-percentage>,表示运算符后的空间量。

separator

一个 <boolean>,表示运算符是否是一个分隔符(例如逗号)。该属性没有视觉效果。

stretchy

一个 <boolean>,表示运算符是否拉伸到相邻元素的大小。

symmetric

一个 <boolean>,表示拉伸运算符是否应该与虚拟的数学轴(中心分数线)垂直对称。

备注: 对于 lspacemaxsizeminsizerspace 属性,一些浏览器可能还接受旧版 MathML 长度

示例

html
<math display="block">
  <mrow>
    <mn>5</mn>
    <mo>+</mo>
    <mn>5</mn>
  </mrow>
</math>

<math display="block">
  <mrow>
    <mo>[</mo> <!-- 默认 form 值:prefix -->
    <mrow>
      <mn>0</mn>
      <mo>;</mo> <!-- 默认 form 值:infix -->
      <mn>1</mn>
    </mrow>
    <mo>)</mo> <!-- 默认 form 值:postfix -->
  </mrow>
</math>

规范

Specification
MathML Core
# operator-fence-separator-or-accent-mo

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
mo
accent
Non-standard
form
largeop
lspace
maxsize
minsize
movablelimits
Named spaces (e.g. thinmathspace to mean 3/18em) for lspace, maxsize, minsize and rspace attributes
DeprecatedNon-standard
Nonzero unitless values (e.g. 5 to mean 500%) for lspace, maxsize, minsize and rspace attributes
DeprecatedNon-standard
rspace
stretchy
symmetric

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.