mathbackground

已弃用:此特性不再推荐。虽然某些浏览器可能仍然支持它,但它可能已经从相关的网络标准中删除,可能正在删除过程中,或者可能仅为兼容性目的而保留。请避免使用它,如果可能,请更新现有代码;请参阅本页底部的兼容性表格以指导您的决策。请注意,此特性可能随时停止工作。

mathbackground 全局属性用于设置 MathML 元素的 背景颜色

注意: 尽可能使用 CSS 来设置 MathML 的样式。mathbackground 属性仅应包含在不支持 CSS 的应用程序中,并且如果设置了 CSS background-color 属性,它将被覆盖。

示例

html
<math display="block" mathbackground="wheat">
  <msqrt>
    <mi>x</mi>
  </msqrt>
</math>

语法

html
<!-- Keyword values -->
<math mathbackground="red">
<math mathbackground="indigo">

<!-- Hexadecimal value -->
<math mathbackground="#bbff00"> <!-- Fully opaque -->
<math mathbackground="#bf0"> <!-- Fully opaque shorthand -->
<math mathbackground="#11ffee00"> <!-- Fully transparent -->
<math mathbackground="#1fe0"> <!-- Fully transparent shorthand -->
<math mathbackground="#11ffeeff"> <!-- Fully opaque -->
<math mathbackground="#1fef"> <!-- Fully opaque shorthand -->

<!-- RGB value -->
<math mathbackground="rgb(255 255 128)"> <!-- Fully opaque -->
<math mathbackground="rgb(117 190 218 / 50%)"> <!-- 50% transparent -->

<!-- HSL value -->
<math mathbackground="hsl(50 33% 25%)"> <!-- Fully opaque -->
<math mathbackground="hsl(50 33% 25% / 75%)"> <!-- 75% opaque, i.e. 25% transparent -->

<color>

背景的统一颜色。

规范

规范
MathML Core
# dfn-mathbackground
  • 在 MathML 3 及更早版本中,支持的值集更为有限。自 MathML Core 起,语法与 CSS <color> 值匹配。

  • 此属性是为不支持 CSS 的 MathML 应用程序设计的。自 MathML Core 起,建议改用等效的 CSS。

浏览器兼容性

另见