--- title: slug: Web/MathML/Element/mspace translation_of: Web/MathML/Element/mspace ---
{{MathMLRef}}

MathML<mspace>元素用来表示一段空白,空白的大小由它自身的属性决定。

属性

class, id, style
用来供样式表使用。
depth
空白在基线下方的高度 (参阅 length).
height
空白在基线上方的高度 (参阅 length).
linebreak
Indicates a line-break at the space. Possible values: auto (default value), newline, nobreak, goodbreak, badbreak.
Starting with MathML 3, it is preferred to use {{ MathMLElement("mo") }} to control linebreaking.
mathbackground
用来设置背景色,可以使用#rgb#rrggbb或者HTML颜色名
width
空白的宽度 (参阅 length).

注意,一些像mathcolormathvariantdir这种常用的属性在<mspace>上是无效的。

例子

<math>

  <mspace depth="40px" height="20px" />

  <mspace width="100px" />

</math>

规范

Specification Status Comment
{{ SpecName('MathML3', 'chapter3.html#presm.mspace', 'mspace') }} {{ Spec2('MathML3') }} Current specification
{{ SpecName('MathML2', 'chapter3.html#presm.mspace', 'mspace') }} {{ Spec2('MathML2') }} Initial specification

浏览器兼容性

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatNo}} {{ CompatGeckoDesktop("1.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}
linebreak {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
depth, height, width {{CompatNo}} {{ CompatGeckoDesktop("1.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatNo}} {{CompatNo}} {{ CompatGeckoMobile("1.9.2") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}
linebreak {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
depth, height, width {{CompatNo}} {{CompatNo}} {{ CompatGeckoMobile("1.9.2") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}

Gecko说明

相关链接