1

由于我们针对 WCAG 2.0 优化了 HTML 标记,因此我们在 google 搜索结果(包括我们的 google 站点搜索)中有很多(有时是丑陋的)图像描述。有谁知道从结果描述中隐藏它们的方法?

例子:

<h1>fiscal authority</h1> <img src="..." alt="The image shows the entrance of the fiscal authority" /> <p> The fiscal authority is... </p>

搜索结果:

Fiscal authority
----------------
The Image shows the entrance of the fiscal authority The fiscal authority is...

我们不可以...

使用屏幕阅读器的访问者应该获得替代文本。我相信这应该是 WCAG 的一个常见问题,我想听听其他开发人员是如何解决这个问题的?

4

1 回答 1

1

WCAG 技术 H67明确指出:

该技术的目的是展示如何标记图像,以便辅助技术可以忽略它们。

如果没有使用标题属性,并且 alt 文本设置为 null(即 alt=""),则它向辅助技术表明可以安全地忽略图像。

鉴于 BITV 非常清楚地遵循 WCAG 标准,那么alt纯装饰图像(如门口)的空标签是完全可以的。重要的是要认识到 WCAG 是一组高度主观的建议和技术。许多测试是不可自动化的,所以如果你能恰当地论证合规性就足够了。

考虑以下:

<h1>fiscal authority</h1>
<img src="doorway.bmp" alt="" />
<p>
   The fiscal authority is an institute for authorising fiduciary claims.
</p>

在这里,门口的存在纯粹是一种装饰。

并与之对比:

<h1>Doorway</h1>
<img src="doorway.bmp" alt="A Victorian-style doorway with beveled edging." />
<p>
   A doorway is a hole cut in a wall to allow passage between rooms.
</p>

这是为文本添加上下文的门口图像(尽管图像可能放置得更好)。

于 2014-08-05T04:15:33.287 回答