mathcolor

已弃用: 不再推荐使用该特性。虽然一些浏览器仍然支持它,但也许已从相关的 web 标准中移除,也许正准备移除或出于兼容性而保留。请尽量不要使用该特性,并更新现有的代码;参见本页面底部的兼容性表格以指导你作出决定。请注意,该特性随时可能无法正常工作。

mathbackground 全局属性设置 MathML 元素的颜色

备注: 尽可能使用 CSS 来为 MathML 设置样式。mathcolor 属性应仅在不支持 CSS 并且将被 CSS color 属性值覆盖的应用程序中使用。

语法

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>

设置元素的文本和装饰部分的颜色,包括例如分数线或根号符号等。

规范

Specification
MathML Core
# dfn-mathcolor
  • 在 MathML 3 和更早版本中,支持的值集更有限。自 MathML 核心版本以来,语法与 CSS <color> 值相匹配。
  • 此属性旨在用于不支持 CSS 的 MathML 应用程序。自 MathML 核心版本以来,推荐使用等效的 CSS。

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
mathcolor
Deprecated

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Deprecated. Not for use in new websites.
See implementation notes.

参见