CSS - math-style
概要
| 属性名 | math-style |
|---|---|
| 値 | normal | compact |
| 初期値 | normal (※実装は compact ?) |
| 適用可能要素 | すべての要素 |
| 継承 | 継承する |
| サポート | https://caniuse.com/mdn-css_properties_math-style |
説明
MathML における数式の大きさを指定します。
- normal
- 通常通り表示します。
- compact
- コンパクトに表示します。
使用例
math-style: compact を指定した方がコンパクトに表示されます。仕様書ではデフォルトは normal となっていますが、Chrome や Firefox などの実装では compact がデフォルトになっているようです。
HTML
<math style="math-style:normal;">
<mrow>
<munderover>
<mo>∑</mo>
<mrow>
<mi>n</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow>
<mo>+</mo>
<mn>∞</mn>
</mrow>
</munderover>
</mrow>
</math>
<math style="math-style:compact;">
<mrow>
<munderover>
<mo>∑</mo>
<mrow>
<mi>n</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow>
<mo>+</mo>
<mn>∞</mn>
</mrow>
</munderover>
</mrow>
</math>
表示
リンク
- https://w3c.github.io/mathml-core/#the-math-style-property
- https://developer.mozilla.org/ja/docs/Web/CSS/math-style
- https://caniuse.com/mdn-css_properties_math-style
Copyright (C) 2025 杜甫々
初版:2025年3月2日、最終更新:2025年3月2日
https://www.tohoho-web.com/css/prop/math-style.htm