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-size
math-depth
math-style