math-shift
math-shift 属性指示 MathML 公式中的上标是按正常偏移还是紧凑偏移提升。
语法
css
/* Keyword values */
math-shift: normal;
math-shift: compact;
/* Global values */
math-shift: inherit;
math-shift: initial;
math-shift: revert;
math-shift: revert-layer;
math-shift: unset;
值
normal-
初始值表示正常渲染。MathML 公式中的上标使用 OpenType MATH 表中的 superscriptShiftUp 参数。
compact-
表示紧凑渲染。MathML 公式中的上标使用 OpenType MATH 表中的 superscriptShiftUpCramped 参数,该参数通常更小。
正式定义
正式语法
math-shift =
normal |
compact
示例
CSS
css
math {
math-shift: compact;
font-size: 64pt;
}
.normal-shift {
math-shift: normal;
}
.compact-shift {
math-shift: compact;
}
MathML
以下 MathML 使用带有 OpenType MATH 表的字体显示了“x 平方”的两个版本。实现了 math-shift 属性的浏览器应该使用略微不同的偏移来提升上标。
html
<math>
<msup class="normal-shift">
<mi>x</mi>
<mn>2</mn>
</msup>
<msup class="compact-shift">
<mi>x</mi>
<mn>2</mn>
</msup>
</math>
规范
| 规范 |
|---|
| MathML Core # the-math-shift |
浏览器兼容性
加载中…