HTML5 MathML
HTML5 MathML Attribute Complete Reference
This reference lists the attributes you can apply to MathML elements inside the HTML5 <math> root, covering styling, layout, table and interaction attributes.
MathML Attributes
| Attribute | Description |
|---|---|
| display | On <math>: renders the formula inline or as a centred block. |
| mathvariant | Sets the font style of token content (bold, italic, double-struck). |
| mathsize | Sets the font size of the content. |
| mathcolor | Sets the foreground (text) colour. |
| mathbackground | Sets the background colour. |
| id | Global unique identifier for CSS, scripting and linking. |
| class | Global class name for CSS styling. |
| style | Global inline CSS styling. |
| dir | Text direction (ltr or rtl). |
| linethickness | On <mfrac>: thickness of the fraction bar. |
| notation | On <menclose>: the enclosing notation (box, circle, strike). |
| stretchy | On <mo>: allows the operator to stretch to its content. |
| symmetric | On <mo>: stretches the operator symmetrically about the axis. |
| largeop | On <mo>: enlarges the operator in display style. |
| movablelimits | On <mo>: moves limits between over/under and sub/sup positions. |
| separator | On <mo>: marks the operator as a separator (e.g. a comma). |
| fence | On <mo>: marks the operator as a fence (bracket). |
| lspace | Leading space before an operator or padded content. |
| rspace | On <mo>: trailing space after the operator. |
| accent | On <mover>/<munder>: renders the script as a tight accent. |
| accentunder | On <munder>/<munderover>: renders the under-script as an accent. |
| open | On <mfenced>: the opening fence character. |
| close | On <mfenced>: the closing fence character. |
| separators | On <mfenced>: characters placed between children. |
| width | Reported width, on <mpadded>, <mspace> and <mglyph>. |
| height | Reported height above the baseline. |
| depth | Reported depth below the baseline. |
| voffset | On <mpadded>: vertical shift of content. |
| actiontype | On <maction>: the interactive action type. |
| selection | On <maction>: 1-based index of the displayed child. |
| frame | On <mtable>: draws a border around the table. |
| align | On <mtable>: vertical alignment relative to surroundings. |
| rowalign | Vertical alignment of table rows or cells. |
| columnalign | Horizontal alignment of table columns or cells. |
| rowspacing | Space between table rows. |
| columnspacing | Space between table columns. |
| rowlines | Lines drawn between table rows. |
| columnlines | Lines drawn between table columns. |
| scriptsizemultiplier | On <mstyle>: shrink factor per nested script level. |
| scriptlevel | On <mstyle>: sets the script (size) level for descendants. |
| mathvariant | Overrides the default font style of a token element. |
| src | On <mglyph>: the image source for a custom glyph. |
| alt | On <mglyph>: fallback text for a custom glyph. |
ℹ️
Attributes marked as belonging to deprecated elements (such as those on <mfenced> or non-Core table attributes) may not work in all browsers; prefer MathML Core features and CSS where possible.
