HTML5 MathML

HTML5 MathML mathsize Attribute

The mathsize attribute sets the font size of a MathML element's content. It accepts length values or size keywords and is most useful on token elements.


Definition and usage

The mathsize attribute changes the size of the glyphs in an element. Values may be a length (such as 20px or 1.5em) or, in older MathML, keywords like small, normal and big. Increasing the size draws attention to a symbol or term.

Which elements use it

  • Token elements such as <mi>, <mn>, <mo>, <mtext> and container elements accept mathsize.

Example

Enlarging a variable
<math>
  <mrow>
    <mi mathsize="24px">x</mi>
    <mo>+</mo>
    <mn>1</mn>
  </mrow>
</math>

The identifier x is rendered at 24px, larger than the surrounding operator and number.

ℹ️

In MathML Core the CSS font-size property is preferred and length values are widely supported; the older keyword values for mathsize are less reliable.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships