<mspace>

  • Revision slug: MathML/Element/mspace
  • Revision title: mspace
  • Revision id: 382701
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment

Revision Content

The MathML <mspace> element is used to display a blank space, whose size is set by its attributes.

Attributes

class, id, style
Provided for use with stylesheets.
depth
The desired depth (below the baseline) of the space (see length for values and units).
height
The desired height (above the baseline) of the space (see length for values and units).
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
The background color. You can use #rgb, #rrggbb and HTML color names.
width
The desired width of the space (see length for values and units).

Note that some common attributes like mathcolor, mathvariant or dir have no effect on <mspace>.

 

Examples

<math>

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

  <mspace width="100px" />

</math>

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatNo() }} {{ CompatGeckoDesktop("1.0") }} {{ CompatNo() }} 9.5 {{ CompatNo() }}
linebreak {{ CompatNo() }} {{ CompatNo() }} {{ bug("380266") }} {{ CompatNo() }} 9.5 (badbreak is not supported) {{ 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() }} {{ bug("380266") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
depth, height, width {{ CompatNo() }} {{ CompatNo() }} {{ CompatGeckoMobile("1.9.2") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

Gecko-specific notes

  • Indentation attributes are not implemented yet (for Gecko see {{ bug("534962") }}).
  • Support for negative values for the width attribute has been implemented in Gecko 23.0 {{geckoRelease("23.0")}}.

Specifications

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

See also

  • {{ MathMLElement("mpadded") }}
  • {{ MathMLElement("mphantom") }}

Revision Source

<p>The MathML <code>&lt;mspace&gt;</code> element is used to display a blank space, whose size is set by its attributes.</p>
<h2 id="Attributes">Attributes</h2>
<dl>
  <dt id="attr-class-id-style">
    class, id, style</dt>
  <dd>
    Provided for use with <a href="/en-US/docs/CSS">stylesheets</a>.</dd>
  <dt id="attr-depth">
    depth</dt>
  <dd>
    The desired depth (below the baseline) of the space (see <a href="/en-US/docs/MathML/Attributes/Values#Lengths">length</a> for values and units).</dd>
  <dt id="attr-height">
    height</dt>
  <dd>
    The desired height (above the baseline) of the space (see <a href="/en-US/docs/MathML/Attributes/Values#Lengths">length</a> for values and units).</dd>
  <dt id="attr-linebreak">
    linebreak</dt>
  <dd>
    Indicates a line-break at the space. Possible values: <code>auto</code> (default value), <code>newline</code>, <code>nobreak</code>, <code>goodbreak</code>, <code>badbreak</code>.<br />
    Starting with MathML 3, it is preferred to use {{ MathMLElement("mo") }} to control linebreaking.</dd>
  <dt id="attr-mathbackground">
    mathbackground</dt>
  <dd>
    The background color. You can use <code>#rgb</code>, <code>#rrggbb</code> and <a href="/en-US/docs/CSS/color_value#Color_Keywords">HTML color names</a>.</dd>
  <dt id="attr-width">
    width</dt>
  <dd>
    The desired width of the space (see <a href="/en-US/docs/MathML/Attributes/Values#Lengths">length</a> for values and units).</dd>
</dl>
<p>Note that some common attributes like <code>mathcolor</code>, <code>mathvariant</code> or <code>dir</code> have no effect on <code>&lt;mspace&gt;</code>.</p>
<p>&nbsp;</p>
<h2 id="Examples">Examples</h2>
<pre class="brush: html">
&lt;math&gt;

  &lt;mspace depth="40px" height="20px" /&gt;

  &lt;mspace width="100px" /&gt;

&lt;/math&gt;
</pre>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoDesktop("1.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>9.5</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>linebreak</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }} {{ bug("380266") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>9.5 (<code>badbreak</code> is not supported)</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>depth</code>, <code>height</code>, <code>width</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoDesktop("1.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Chrome for Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoMobile("1.9.2") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>linebreak</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }} {{ bug("380266") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>depth</code>, <code>height</code>, <code>width</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoMobile("1.9.2") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h3>Gecko-specific notes</h3>
<ul>
  <li><a class="external" href="http://www.w3.org/TR/MathML3/chapter3.html#presm.lbindent.attrs" title="http://www.w3.org/TR/MathML3/chapter3.html#presm.lbindent.attrs">Indentation attributes</a> are not implemented yet (for Gecko see {{ bug("534962") }}).</li>
  <li>Support for negative values for the <code>width</code> attribute has been implemented in Gecko 23.0 {{geckoRelease("23.0")}}.</li>
</ul>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table" height="49" width="1000">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('MathML3', 'chapter3.html#presm.mspace', 'mspace') }}</td>
      <td>{{ Spec2('MathML3') }}</td>
      <td>Current specification</td>
    </tr>
    <tr>
      <td>{{ SpecName('MathML2', 'chapter3.html#presm.mspace', 'mspace') }}</td>
      <td>{{ Spec2('MathML2') }}</td>
      <td>Initial specification</td>
    </tr>
  </tbody>
</table>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{ MathMLElement("mpadded") }}</li>
  <li>{{ MathMLElement("mphantom") }}</li>
</ul>
Revert to this revision