mathcolor
已棄用:此特性不再推薦。雖然某些瀏覽器可能仍然支援它,但它可能已經從相關的網路標準中刪除,可能正在刪除過程中,或者可能僅為相容性目的而保留。請避免使用它,如果可能,請更新現有程式碼;請參閱本頁底部的相容性表格以指導您的決策。請注意,此特性可能隨時停止工作。
mathcolor 全域性屬性用於設定 MathML 元素的 顏色。
注意: 儘可能使用 CSS 來設定 MathML 的樣式。mathcolor 屬性僅應包含在對 CSS 不敏感的應用程式中,並且如果設定了 CSS color 屬性,它將被 CSS color 屬性覆蓋。
示例
html
<math display="block">
<msqrt mathcolor="tomato">
<mi mathcolor="darkgreen">x</mi>
</msqrt>
</math>
語法
html
<!-- Keyword values -->
<math mathcolor="currentColor">
<!-- <named-color> values -->
<math mathcolor="red">
<math mathcolor="orange">
<math mathcolor="tan">
<math mathcolor="rebeccapurple">
<!-- <hex-color> values -->
<math mathcolor="#090">
<math mathcolor="#009900">
<math mathcolor="#090a">
<math mathcolor="#009900aa">
<!-- <rgb()> values -->
<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()> values -->
<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()> values -->
<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。
瀏覽器相容性
載入中…