<mrow>

MathML <mrow> 元素用于对连续多行表达式的不同子表达式进行分组,一条子表达式通常算作一行,至少包含一或多个操作符与其运算对象(比如 <mi><mn>)。此元素呈现为包含其内容的水平行。

在编写 MathML 表达式时,您应该使用 <mrow> 将表达式中的元素分组,就像它们在数学解释时的分成一行行一样。正确的分组有助于表达式的呈现,具体体现在以下几个方面:

  • 如果有需要,它会改变间距来改善显示效果。
  • 它允许采用更明智的断行和缩进算法。
  • 通过自动化系统,如计算机代数系统和音频渲染器(automated systems such as computer algebra systems and audio renderers),它能简化表达式的解释(interpretation)过程。

属性

class, id, style
用来供样式表使用。
dir
行内公式的书写方向。可能的值为 ltr(自左向右)或 rtl(自右向左)。
href
用于设置一个指向指定的 URI 的超链接。
mathbackground
背景色。支持 #rgb#rrggbbHTML 颜色
mathcolor
文本颜色。支持 #rgb#rrggbbHTML 颜色

示例

<math> 

  <mrow>
    <mn> 1 </mn>
    <mo> + </mo>
    <mn> 1 </mn>
  </mrow>
 
  <mrow>
    <mo> ( </mo>
    <mrow>
      <mi> x </mi>
      <mo> , </mo>
      <mi> y </mi>
    </mrow>
    <mo> ) </mo>
  </mrow>

</math>

规范

规范 状态 备注
MathML 3.0
mrow
Recommendation Current specification
MathML 2.0
mrow
Recommendation Initial specification

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
mrowChrome No support NoEdge No support NoFirefox Full support 1IE No support NoOpera No support NoSafari Full support 6WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
dirChrome No support NoEdge No support NoFirefox Full support 12IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 14Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
hrefChrome No support NoEdge No support NoFirefox Full support 7IE No support NoOpera No support NoSafari Full support 10WebView Android No support NoChrome Android No support NoFirefox Android Full support 7Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
mathbackgroundChrome No support NoEdge No support NoFirefox Full support 4IE No support NoOpera No support NoSafari Full support 6WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
mathcolorChrome No support NoEdge No support NoFirefox Full support 4IE No support NoOpera No support NoSafari Full support 6WebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support

参见

  • HTML 分组元素:<div>