displaystyle

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2023.

The displaystyle global attribute is a boolean setting the math-style of a MathML element.

Example

In this example, an munder element is used to attach a script "A" to a base "∑". By default, the summation symbol is rendered with the font-size inherited from its parent and the A as a scaled down subscript. With the explicit displaystyle="true" attribute, the summation symbol is instead drawn bigger and the "A" becomes an underscript.

html
<math>
  <munder>
    <mo>∑</mo>
    <mi>A</mi>
  </munder>
  <munder displaystyle="true">
    <mo>∑</mo>
    <mi>A</mi>
  </munder>
</math>

Syntax

html
<math displaystyle="true">
<math displaystyle="false">

Values

true

Sets the display style to normal.

false

Sets the display style to compact.

Specifications

Specification
MathML Core
# dfn-displaystyle

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
displaystyle
Chrome – Full support
Chrome 109 (Release date: 2023-01-10)
footnote Full support
Edge – Full support
Edge 109 (Release date: 2023-01-12)
footnote Full support
Firefox – Full support
Firefox 83 (Release date: 2020-11-17)
footnote
footnote Prior to Firefox 83, the attribute was only accepted on a few elements, as specified in MathML 3, and was not implemented via math-style.
footnote See https://hg.mozilla.org/mozilla-central/rev/60a72a6c7c1d
Opera – Full support
Opera 95 (Release date: 2023-02-01)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote
footnote Since Safari 14.1, this attribute is implemented via math-style.
footnote See https://trac.webkit.org/changeset/267578
Chrome Android – Full support
Chrome Android 109 (Release date: 2023-01-10)
footnote Full support
Firefox for Android – Full support
Firefox for Android 83 (Release date: 2020-11-17)
footnote
footnote Prior to Firefox for Android 83, the attribute was only accepted on a few elements, as specified in MathML 3, and was not implemented via math-style.
footnote See https://hg.mozilla.org/mozilla-central/rev/60a72a6c7c1d
Opera Android – Full support
Opera Android 74 (Release date: 2023-03-13)
footnote Full support
Safari on iOS – Full support
Safari on iOS 14 (Release date: 2020-09-16)
footnote
footnote Since Safari on iOS 14.1, this attribute is implemented via math-style.
footnote See https://trac.webkit.org/changeset/267578
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 109 (Release date: 2023-01-10)
footnote Full support
WebView on iOS – Full support
WebView on iOS 14 (Release date: 2020-09-16)
footnote
footnote Since WebView on iOS 14.1, this attribute is implemented via math-style.
footnote See https://trac.webkit.org/changeset/267578

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.

See also