math-style
math-style
属性指示 MathML 公式应以正常高度还是紧凑高度呈现。
语法
css
/* Keyword values */
math-style: normal;
math-style: compact;
/* Global values */
math-style: inherit;
math-style: initial;
math-style: revert;
math-style: revert-layer;
math-style: unset;
值
正式定义
正式语法
math-style =
normal |
compact
示例
将公式的样式更改为紧凑
CSS
css
math {
math-style: normal;
}
.compact {
math-style: compact;
}
HTML
html
<p>
Normal height
<math>
<mrow>
<munderover>
<mo>∑</mo>
<mrow>
<mi>n</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow>
<mo>+</mo>
<mn>∞</mn>
</mrow>
</munderover>
</mrow>
</math>
and compact height
<math class="compact">
<mrow>
<munderover>
<mo>∑</mo>
<mrow>
<mi>n</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow>
<mo>+</mo>
<mn>∞</mn>
</mrow>
</munderover>
</mrow>
</math>
equations.
</p>
结果
规范
规范 |
---|
MathML Core # the-math-style-property |
浏览器兼容性
BCD 表格仅在浏览器中加载