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。

瀏覽器相容性

另見