【发布时间】:2020-01-18 20:52:02
【问题描述】:
例如,如果我有以下 SVG 图像:
<svg role="img" viewbox="0 0 100 50" height="100px">
<title>Site Logo</title>
<rect x="0" y="00" width="100" height="10" fill="red"></rect>
<rect x="0" y="10" width="100" height="10" fill="salmon"></rect>
<rect x="0" y="20" width="100" height="10" fill="pink"></rect>
<rect x="0" y="30" width="100" height="10" fill="aqua"></rect>
<rect x="0" y="40" width="100" height="10" fill="blue"></rect>
</svg>
我应该通过设置role=img 并包含<title> 元素来点击a11y svg guidelines
但是,当我运行 Accessibility Audit in Firefox 时,它会为 SVG 中的每个元素/图形(路径、矩形、圆环)添加一个警告,并带有以下警告:
带有图片的内容必须加标签。 Learn more
但我肯定不需要标记 svg 中的每条路径吗?
我应该如何改进 a11y 或向 FF 指出正确的替代文本是什么?
【问题讨论】:
标签: html firefox svg accessibility firefox-developer-tools