<desc>
<desc> SVG 元素為任何 SVG 容器元素或 圖形元素 提供了一個可訪問的長文字描述。
<desc> 元素中的文字不會作為圖形的一部分進行渲染。如果元素可以透過可見文字進行描述,則可以使用 aria-describedby 屬性來引用該文字。如果使用了 aria-describedby,它將優先於 <desc>。
<desc> 元素的隱藏文字也可以透過 aria-describedby 值中的多個 ID 與其他元素的可見文字連線起來。在這種情況下,<desc> 元素必須提供一個 ID 以供引用。
使用語境
| 分類 | 描述性元素 |
|---|---|
| 允許內容 | 任何元素或字元資料 |
屬性
此元素僅包含全域性屬性。
DOM 介面
此元素實現了 SVGDescElement 介面。
示例
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>
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # DescriptionAndTitleElements |
瀏覽器相容性
載入中…