scriptlevel
scriptlevel 全域性屬性 設定 MathML 元素的 math-depth。它允許覆蓋來自 使用者代理樣式表 的規則,這些規則定義了 MathML 公式中 font-size 的自動計算。
示例
html
<!-- math-depth defaults to 0 on the <math> root. -->
<math style="font-size: 64pt">
<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>
語法
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 -->
值
規範
| 規範 |
|---|
| MathML 核心 # dfn-scriptlevel |
瀏覽器相容性
BCD 表格僅在啟用 JavaScript 的瀏覽器中載入。
另請參閱
- 所有 全域性屬性。
- displaystyle 全域性屬性。
font-sizemath-depthmath-style