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
<!-- 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
<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. Diefont-size
des Elements wird auf denselben Wert wie die von Elementen in der angegebenen Tiefe gesetzt. +<U>
-
Legt die
math-depth
auf den Wertadd(<U>)
fest. Dies verkleinert diefont-size
auf dem Element um das<U>
-Fache. -<U>
-
Legt die
math-depth
auf den Wertadd(-<U>)
fest. Dies vergrößert diefont-size
auf dem Element um das<U>
-Fache.
Spezifikationen
Specification |
---|
MathML Core # dfn-scriptlevel |
Browser-Kompatibilität
BCD tables only load in the browser
Siehe auch
- Alle globalen Attribute.
- Das globale Attribut displaystyle.
font-size
math-depth
math-style