1. 開発者向けのウェブ技術
  2. CSS
  3. リファレンス
  4. プロパティ
  5. math-style

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

math-style

Baseline 広く利用可能

この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2023年8月以降、すべてのブラウザーで利用可能です。

math-style プロパティは、 MathML の数式を通常の高さで表示するか、コンパクトな高さで表示するかを指定します。

構文

css
/* キーワード値 */
math-style: normal;
math-style: compact;
/* グローバル値 */
math-style: inherit;
math-style: initial;
math-style: revert;
math-style: revert-layer;
math-style: unset;

normal

初期値であり、通常のレンダリングを示します。

compact

子孫の数式のレイアウトの論理高を最小化しようとします。

公式定義

初期値 normal
適用対象すべての要素
継承 あり
計算値 指定通り
アニメーションの種類 アニメーション不可

形式文法

math-style = 
normal |
compact
この構文は MathML Core による最新の標準を反映しています。すべてのブラウザーがすべての部分を実装しているわけではありません。サポート情報についてはブラウザーの互換性を参照してください。

数式のスタイルを 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

ブラウザーの互換性

関連情報

MDN の改良に協力

協力方法を知る

このページは MDN の貢献者によって に最終更新されました。

AltStyle によって変換されたページ (->オリジナル) /