mathcolor

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Thuộc tính toàn cục mathcolor đặt color của một phần tử MathML.

Note: Hãy dùng CSS để tạo kiểu MathML khi có thể. Thuộc tính mathcolor chỉ nên được dùng cho các ứng dụng không nhận biết CSS và sẽ bị ghi đè bởi giá trị thuộc tính CSS color, nếu có.

Ví dụ

html
<math display="block">
  <msqrt mathcolor="tomato">
    <mi mathcolor="darkgreen">x</mi>
  </msqrt>
</math>

Cú pháp

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%)">

Giá trị

<color>

Đặt màu cho các phần văn bản và phần trang trí của phần tử, bao gồm ví dụ như thanh phân số hoặc ký hiệu căn.

Đặc tả

Specification
MathML Core
# dfn-mathcolor
  • Trong MathML 3 và các phiên bản cũ hơn, chỉ hỗ trợ một tập giá trị hạn chế hơn. Từ MathML Core, cú pháp khớp với các giá trị CSS <color>.

  • Thuộc tính này được thiết kế cho các ứng dụng MathML không nhận biết CSS. Từ MathML Core, nên dùng CSS tương đương thay thế.

Khả năng tương thích trình duyệt

Xem thêm