scriptlevel

Das scriptlevel globale Attribut legt die math-depth eines MathML-Elements fest. Es ermöglicht das Überschreiben von Regeln aus dem User-Agent-Stylesheet, die die automatische Berechnung der font-size innerhalb von MathML-Formeln definieren.

Beispiel

html
<!-- math-depth defaults to 0 on the <math> root. -->
<math style="font-size: 24px">
  <msubsup>
    <!-- math-depth and font-size remain unchanged on the base. -->
    <mtext>base</mtext>
    <!-- math-depth defaults to add(1) within the subscript, so it
         is incremented by 1 and the font-size is scaled down once. -->
    <mtext>subscript</mtext>
    <!-- math-depth defaults to add(1) within the superscript too, but
         the scriptlevel attribute tells to increment it by 2 instead,
         so the font-size is actually scaled down twice. -->
    <mtext scriptlevel="+2">superscript</mtext>
  </msubsup>
</math>

Syntax

html
<math scriptlevel="-1"> <!-- decrease math-depth by 1 -->
<math scriptlevel="+2"> <!-- increase math-depth by 2 -->
<math scriptlevel="0"> <!-- reset math-depth to 0 -->

Werte

Wenn <U> eine nicht negative ganzzahlige Zahl ist (d. h. ohne ein vorangestelltes Vorzeichen), dann sind die akzeptierten Werte:

<U>

Legt die math-depth auf den Wert <U> fest. Die font-size des Elements wird auf denselben Wert wie die von Elementen in der angegebenen Tiefe gesetzt.

+<U>

Legt die math-depth auf den Wert add(<U>) fest. Dies verkleinert die font-size auf dem Element um das <U>-Fache.

-<U>

Legt die math-depth auf den Wert add(-<U>) fest. Dies vergrößert die font-size auf dem Element um das <U>-Fache.

Spezifikationen

Specification
MathML Core
# dfn-scriptlevel

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
scriptlevel

Legend

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

Full support
Full support
No support
No support
See implementation notes.

Siehe auch