The MathML <mstyle> element is used change the style of its children. It accepts all attributes of all MathML presentation elements with some exceptions and additional attributes listed below.


Overall directionality of formulas. Possible values are either ltr (left to right) or rtl (right to left).
This attribute is specifying the character for the alignment point within <mstack> and <mtable> columns, if the decimalpoint value is used to specify the alignment.
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also largeop and movablelimits on <mo>.
Specifies the default linebreakstyle to use for infix operators. The values before, after and duplicate are allowed.
Controls mostly the font-size. The higher the scriptlevel, the smaller the font size. This attribute accepts a non-negative integer, as well as a "+" or a "-" sign, which increments or decrements the current value. In addition, the scriptlevel attribute can never reduce the font size below scriptminsize in order to avoid unreadable small font sizes and depends on the multiplier specified in scriptsizemultiplier.
Specifies a minimum font size allowed due to changes in scriptlevel. The default value is 8pt.
Specifies the multiplier to be used to adjust font size due to changes in scriptlevel. The default value is 0.71.

The <mstyle> element accepts all attributes of all presentation elements with the following exceptions:


Using displaystyle and mathcolor to effect style changes in the layout of the whole sum.


  <mstyle displaystyle="true" mathcolor="teal">
        <mo stretchy="true" form="prefix">&sum;</mo>
          <mo form="infix">=</mo>

      <mstyle displaystyle="true">




Specification Status Comment
MathML 3.0
The definition of 'mstyle' in that specification.
Recommendation Current specification
MathML 2.0
The definition of 'mstyle' in that specification.
Recommendation Initial specification

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No No1 No No5.1
decimalpoint No No No No No No
dir No No12 No No No
displaystyle No No1 No No No
infixbreakstyle No No No No No No
scriptlevel No No1 No No No
scriptminsize No No1 No No No
scriptsizemultiplier No No1 No No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No No No4 No5.1 ?
decimalpoint No No No No No No ?
dir No No No14 No No ?
displaystyle No No No4 No No ?
infixbreakstyle No No No No No No ?
scriptlevel No No No4 No No ?
scriptminsize No No No4 No No ?
scriptsizemultiplier No No No4 No No ?

Gecko-specific notes

  • Prior to Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3) the implementation of <mstyle> was not complete and has been corrected. In particular, setting these attributes on mstyle had no effect to its children:
    • The bevelled attribute on <mfrac> elements.
    • The notation attribute on <menclose> elements.
    • The open, close and separators attributes on <mfenced> elements.
    • The accent and accentunder attributes on <mover>, <munder> and <munderover> elements.
    • The selection attribute on <maction> elements.
    • The mathvariant attribute on <mi> elements.
  • Starting with Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) unitless values and percent values for the scriptminsize attribute are allowed and interpreted as multiple of "8pt".
  • Starting with Gecko 29.0 (Firefox 29.0 / Thunderbird 29.0 / SeaMonkey 2.26), the attributes accepted on the <mstyle> element have been restricted to those actually used in practice: id, class, style, href, mathcolor, mathbackground, scriptlevel, displaystyle, scriptsizemultiplier, scriptminsize, dir, mathsize, mathvariant, fontfamily, fontweight, fontstyle, fontsize, color, background.

Document Tags and Contributors

Contributors to this page: ExE-Boss, Draussenduscher, fscholz, fred.wang, Sheppy
Last updated by: ExE-Boss,