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 |
瀏覽器相容性
載入中…