<desc>

<desc> 元素為任何 SVG 容器元素圖形元素 提供可訪問的、長文字描述。

<desc> 元素中的隱藏文字不會作為圖形的一部分呈現。如果元素可以透過可見文字描述,則可以使用 aria-describedby 屬性引用該文字。如果使用 aria-describedby,它將優先於 <desc>

<desc> 元素的隱藏文字也可以使用 aria-describedby 值中的多個 ID 與其他元素的可見文字連線起來。在這種情況下,<desc> 元素必須提供一個 ID 用於引用。

示例

html
<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
  <circle cx="5" cy="5" r="4">
    <desc>
      I'm a circle and that description is here to demonstrate how I can be
      described, but is it really necessary to describe a simple circle like me?
    </desc>
  </circle>
</svg>

屬性

此元素僅包含全域性屬性

使用上下文

類別描述性元素
允許內容任何元素或字元資料

規範

規範
可縮放向量圖形 (SVG) 2
# DescriptionAndTitleElements

瀏覽器相容性

BCD 表格僅在瀏覽器中載入

另請參見