此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
scriptlevel
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
scriptlevel全局属性设置 MathML 元素的数学深度。它允许覆盖用户代理样式表中定义的在 MathML 公式中自动计算字体大小的规则。
In this article
示例
html
<!-- math-depth 在 <math> 根元素上默认为 0。 --><math> <msubsup> <!-- base 上的 math-depth 和 font-size 保持不变。 --> <mtext>BASE</mtext> <!-- math-depth 在下标中默认为 add(1),因此增加了 1,字体大小缩小了一次。 --> <mtext>SUBSCRIPT</mtext> <!-- 上标中的 math-depth 也默认为 add(1),但 scriptlevel 属性告诉它增加 2,因此实际上字体大小缩小了两次。 --> <mtext scriptlevel="+2">SUPERSCRIPT</mtext> </msubsup></math>语法
html
<math scriptlevel="-1"> <!-- 将 math-depth 减小 1 --><math scriptlevel="+2"> <!-- 将 math-depth 增加 2 --><math scriptlevel="0"> <!-- 重置 math-depth 为 0 -->值
如果<U> 是一个无符号整数(即移除了前缀符号的整数),则接受的值为:
规范
| Specification |
|---|
| MathML Core> # dfn-scriptlevel> |