<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 |
浏览器兼容性
加载中…