HTML5 MathML

HTML5 MathML height Attribute

The height attribute sets the height (the extent above the baseline) reported for a MathML element. It is used on layout elements such as <mpadded>, <mspace> and <mglyph>.


Definition and usage

The height attribute specifies how much vertical space above the baseline an element reports. On <mspace> it sets the height of the blank space; on <mpadded> it overrides the child's reported height. Values are lengths such as 10px, 1em or 0.

Which elements use it

  • <mspace> - height of the blank space.
  • <mpadded> - overridden reported height of the content.
  • <mglyph> - display height of the glyph image.

Example

A blank space with a set height
<math>
  <mrow>
    <mi>a</mi>
    <mspace width="10px" height="12px" />
    <mi>b</mi>
  </mrow>
</math>

The <mspace> reserves a gap 10px wide and 12px tall between a and b.

ℹ️

The height attribute is supported on the relevant elements in modern browsers; on <mspace> and <mglyph> it is part of MathML Core.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships