docs.rodeo

MDN Web Docs mirror

mathsize

{{MathMLRef}} {{Deprecated_Header}} 

The mathsize global attribute sets the font-size of a MathML element.

[!NOTE] Use CSS for styling MathML whenever possible. The mathsize attribute should only be included for applications that are not CSS-aware and will be overridden by the CSS font-size property, if set.

Example

html,
body {
  height: 100%;
}

body {
  display: grid;
  place-items: center;
}
<math display="block">
  <msup mathsize="16px">
    <mi>a</mi>
    <mn>2</mn>
  </msup>
  <mo>+</mo>
  <msup mathsize="24px">
    <mi>b</mi>
    <mn>2</mn>
  </msup>
  <mo>=</mo>
  <msup mathsize="32px">
    <mi>c</mi>
    <mn>2</mn>
  </msup>
</math>

{{EmbedLiveSample("Example", "", 150)}} 

Syntax

<!-- <length> values -->
<math mathsize="12px">
<math mathsize="0.8em">

<!-- <percentage> values -->
<math mathsize="80%">

Values

[!NOTE] Some browsers may also accept legacy MathML lengths.

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN