docs.rodeo

MDN Web Docs mirror

{{MathMLRef}} 

The <mpadded> MathML element is used to add extra padding and to set the general adjustment of position and size of enclosed contents.

Attributes

This element’s attributes include the global MathML attributes as well as the following attributes:

Legacy syntax

For the depth, height, lspace, voffset and width attributes, some browsers may instead accept a more complex syntax:

  1. An optional + or - sign as a prefix, specifying an increment or decrement to the corresponding dimension (if absent, the corresponding dimension is set directly to specified value).
  2. Followed by an <unsigned-number> (let’s call it α below).
  3. Optionally followed by a value (if absent, the specified value is interpreted as “100 times α percent”).
    • A unit. The specified value is interpreted the same as legacy MathML lengths.
    • A namedspace constant. The specified value is interpreted as α times the constant.
    • A pseudo-unit width, height or depth. The specified value is interpreted as α times the corresponding dimension of the content.
    • A percent sign followed by a pseudo-unit width, height or depth. The specified value is interpreted as α% the corresponding dimension of the content.

Examples

Dimensions and offsets

<math display="block">
  <mpadded
    width="400px"
    height="5em"
    depth="4em"
    lspace="300px"
    voffset="-2em"
    style="background: lightblue">
    <mi>x</mi>
    <mo>+</mo>
    <mi>y</mi>
  </mpadded>
</math>

{{ EmbedLiveSample('dimensions_and_offsets_example', 700, 200, "", "") }} 

Legacy syntax

<math display="block">
  <!-- increment by a length -->
  <mpadded width="+20px" style="background: lightblue">
    <mtext>+20px</mtext>
  </mpadded>

  <!-- set to a pseudo-unit -->
  <mpadded width="2width" style="background: lightgreen">
    <mtext>2width</mtext>
  </mpadded>

  <!-- increment by a percent of a pseudo-unit -->
  <mpadded width="+400%height" style="background: lightyellow">
    <mtext>+400%height</mtext>
  </mpadded>

  <!-- decrement to a multiple of a namedspace -->
  <mpadded width="-1thickmathspace" style="background: pink">
    <mtext>-.5thickmathspace</mtext>
  </mpadded>
</math>

{{ EmbedLiveSample('legacy_syntax_example', 700, 200, "", "") }} 

Technical summary

Implicit ARIA role None

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN