Changing Font Size with "mstyle"

Q

How to change the default font size with <mstyle>?

✍: FYIcenter.com

A

In a Web browser, the default font size of the <math> element is inherited from it's parent element.

You can use the <mstyle> element to change the default font size as shown in this example:

Using default font size:
<math>
  <mi>r</mi><mo>=</mo><mfrac><mi>d</mi><mn>2</mn></mfrac>
</math>
    
      r=d2
    

Changing default font size to 32px:
<math><mstyle fontsize="32px">
  <mi>r</mi><mo>=</mo><mfrac><mi>d</mi><mn>2</mn></mfrac>
</mstyle></math>
    
      r=d2
    

 

⇒ scriptlevel="0" on "mfrace"

⇐ Subscripts, Fractions and "scriptlevel"

⇑ Subscripts, Fractions and "scriptlevel"

⇑⇑ MathML (Mathematical Markup Language)

2026-10-24, ∼1853🔥, 0💬