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.

The 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:

depth

A indicating the desired depth (below the baseline) of the element.

height

A indicating the desired height (above the baseline) of the element.

lspace

A indicating the horizontal location of the positioning point of the child content with respect to the positioning point of the element.

voffset

A indicating the vertical location of the positioning point of the child content with respect to the positioning point of the element.

width

A indicating the desired horizontal length of the element.

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

html

  
    x
    +
    y
  

css
mpadded {
  background: lightblue;
}

Legacy syntax

html

  
  
    +20px
  

  
  
    2width
  

  
  
    +400%height
  

  
  
    -1thickmathspace
  

css
mpadded:nth-child(1) {
  background: lightblue;
}
mpadded:nth-child(2) {
  background: lightgreen;
}
mpadded:nth-child(3) {
  background: lightyellow;
}
mpadded:nth-child(4) {
  background: pink;
}

Technical summary

Specifications

Specification
MathML Core
# adjust-space-around-content-mpadded

Browser compatibility

See also