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

View in English Always switch to English

mathsize

Deprecated

Avoid using this feature in new projects. Only MathML Core (a subset of MathML Full) is designed to work with web technologies, such as CSS. This feature may be a candidate for removal from web standards or browsers.

Consider using the following features instead: MathML.

mathsizeグローバル属性で、MathML 要素のフォントサイズを設定します。

メモ: 可能な限り、MathML のスタイル設定には CSS を使用してください。mathsize 属性は、CSS に対応していないアプリケーションでのみ使用するべきであり、CSS の font-size プロパティが設定されている場合は、その値によって上書きされます。

html
<math display="block">
  <msup mathsize="16px">
    <mi>a</mi>
    <mn>2</mn>
  </msup>
  <mo>+</mo>
  <msup mathsize="24px">
    <mi>b</mi>
    <mn>2</mn>
  </msup>
  <mo>=</mo>
  <msup mathsize="32px">
    <mi>c</mi>
    <mn>2</mn>
  </msup>
</math>

構文

html
<!-- <length> 値 -->
<math mathsize="12px">
<math mathsize="0.8em">

<!-- <percentage> 値 -->
<math mathsize="80%">

<length>

正の <length> 値。ほとんどのフォント相対単位(emex など)では、フォントサイズは親要素のフォントサイズを基準とした値です。

<percentage>

正の <percentage> 値。親要素のフォントサイズを基準とした値です。

メモ: ブラウザーによっては、古い MathML の長さも受け入れることがあります。

仕様書

仕様書
MathML Core
# dfn-mathsize
  • MathML 3 およびそれ以前のバージョンでは、キーワード smallnormalbig、および MathML 3 特定の長さ指定構文が対応していました。 MathML Core 以降、その構文は CSS の <length-percentage> の値と一致するようになりました。

  • この属性は、CSS に対応していない MathML アプリケーション向けに設計されました。 MathML Core 以降では、代わりに同等の CSS を使用することが推奨されています。

ブラウザーの互換性

関連情報