MathML element

<mstyle> <mstyle>

Applies inherited style properties to descendants.

Role of <mstyle>

Applies inherited style properties to descendants. Use the element for its semantic role rather than as a visual styling shortcut. Assistive technology, browser math layout, conversion tools, and copy-and-paste behavior all depend on the markup preserving the mathematical structure.

Example markup

<mstyle mathcolor="blue"><mi>x</mi></mstyle>

Allowed children

  • presentation MathML

Only place children inside <mstyle> when they match the element's content model. Validate the complete MathML tree after conversion because a locally valid fragment can still be incorrect in its parent context.

Implementation notes

  • Prefer document CSS where practical and test accessibility contrast.

Accessibility and testing

  • Keep a meaningful DOM structure instead of replacing the expression with an image.
  • Test keyboard selection, screen-reader output, browser rendering, and conversion back to LaTeX.
  • Check that fallbacks do not expose raw tags or omit the mathematical relationship represented by <mstyle>.

Reuse, attribution, and correction

Share this reference without losing its source

Copy a citation, permanent link, Markdown link, or self-contained embed card. Each reusable format points readers back to the maintained canonical page.

Report an issue

Search the whole reference

Symbols, formulas, guides, tools and commands

Start typing to search.

move · Enter open · Esc close