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

View in English Always switch to English

mathcolor

非推奨;: この機能は非推奨になりました。まだ対応しているブラウザーがあるかもしれませんが、すでに関連するウェブ標準から削除されているか、削除の手続き中であるか、互換性のためだけに残されている可能性があります。使用を避け、できれば既存のコードは更新してください。このページの下部にある互換性一覧表を見て判断してください。この機能は突然動作しなくなる可能性があることに注意してください。

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 を使用することが推奨されています。

ブラウザーの互換性

関連情報