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

View in English Always switch to English

mathcolor

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.

mathcolorグローバル属性で、MathML 要素のを設定します。

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

html
<math display="block">
  <msqrt mathcolor="tomato">
    <mi mathcolor="darkgreen">x</mi>
  </msqrt>
</math>

構文

html
<!-- キーワード値 -->
<math mathcolor="currentColor">

<!-- <named-color> 値 -->
<math mathcolor="red">
<math mathcolor="orange">
<math mathcolor="tan">
<math mathcolor="rebeccapurple">

<!-- <hex-color> 値 -->
<math mathcolor="#090">
<math mathcolor="#009900">
<math mathcolor="#090a">
<math mathcolor="#009900aa">

<!-- <rgb()> 値 -->
<math mathcolor="rgb(34, 12, 64, 0.6)">
<math mathcolor="rgb(34 12 64 / 0.6)">
<math mathcolor="rgb(34.6 12 64 / 60%)">

<!-- <hsl()> 値 -->
<math mathcolor="hsl(30, 100%, 50%, 0.6)">
<math mathcolor="hsl(30 100% 50% / 0.6)">
<math mathcolor="hsl(30.2 100% 50% / 60%)">

<!-- <hwb()> 値 -->
<math mathcolor="hwb(90 10% 10%)">
<math mathcolor="hwb(90 10% 10% / 0.5)">
<math mathcolor="hwb(90deg 10% 10%)">
<math mathcolor="hwb(1.5708rad 60% 0%)">
<math mathcolor="hwb(.25turn 0% 40% / 50%)">

<color>

要素のテキスト部分および装飾部分の色を設定します。 これには、例えば分数線や根号記号などが含まれます。

仕様書

仕様書
MathML Core
# dfn-mathcolor
  • MathML 3 およびそれ以前のバージョンでは、対応している値の範囲はより限定的でした。 MathML Core 以降、その構文は CSS の <color> の値と一致するようになりました。

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

ブラウザーの互換性

関連情報