math-style
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2023.
Thuộc tính math-style chỉ ra liệu các phương trình MathML có nên được hiển thị với chiều cao thông thường hay chiều cao thu gọn.
Cú pháp
css
/* Giá trị từ khóa */
math-style: normal;
math-style: compact;
/* Giá trị toàn cục */
math-style: inherit;
math-style: initial;
math-style: revert;
math-style: revert-layer;
math-style: unset;
Giá trị
Định nghĩa hình thức
| Initial value | normal |
|---|---|
| Applies to | all elements |
| Inherited | yes |
| Computed value | as specified |
| Animation type | Not animatable |
Cú pháp hình thức
math-style =
normal |
compact
Ví dụ
>Thay đổi kiểu của công thức thành 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>
Kết quả
Đặc tả kỹ thuật
| Specification |
|---|
| MathML Core> # the-math-style-property> |