【发布时间】:2022-02-25 05:19:26
【问题描述】:
我正在阅读WCAG 2.0 Technique H30。
程序说:
对于使用此技术的内容中的每个链接:
- 检查文本或非文本内容的替代文本是 包含在 a 元素中
- 如果 img 元素是 a 元素的唯一内容,请检查 其替代文本描述了 链接
- 如果 a 元素包含一个或多个 img 元素并且文本 img 元素的替代项为空, 检查 文本 链接的描述链接的目的
- 如果 a 元素只包含文本,请检查文本是否描述 链接的目的
我专注于第 2 点:如果 img 具有 alt 属性,但没有替代文本怎么办?
例如,以下代码是否满足该技术要求?
<a href="http://www.mystite.com">
<img src="http://www.mystite.com/myimage.jpg" alt="Description of the image" />
</a>
【问题讨论】:
-
我同意 unor。 alt 应该是
return home或只是home,而不是an icon of a house indicating home
标签: html accessibility wai-aria wcag2.0