gpt4 book ai didi

html - WCAG 2.0 冗余链路

转载 作者:行者123 更新时间:2023-11-27 22:55:33 27 4
gpt4 key购买 nike

我已尝试搜索,但似乎无法找到有关冗余链接和 WCAG 合规性的直接答案。

我有一个包含产品列表的产品系列/类别页面。每个产品都有产品图片、名称、价格和“了解更多”按钮。产品图片和“了解更多”按钮都指向相同的目的地。

<div class="product-wrap">
<div class="product-image">
<a href="product-page.html"><img src="product-image.jpg"></a>
</div>
<div class="product-name">
Sample Product Name
</div>
<div class="product-price">
$29.99
</div>
<div class="product-learn-more">
<a href="product-page.html">Learn More</a>
</div>
</div>

根据我的阅读,相邻链接转到同一位置是不合规的。

我无法链接整个产品,因为我不希望所有内容都可点击,所以我不确定我的选择是什么。

有什么办法使它合规吗?

最佳答案

guidance from W3C指出您应该将图像和文本包装在一个 anchor 元素中。他们还声明您不能省略 alt 属性,因为这会导致 SC 1.1.1. 失败。

如果这在您的实例中不是一个选项,我想到的一种可能的解决方案是使用 aria-hidden div.product-image 上的属性。

Authors MAY, with caution, use aria-hidden to hide visibly rendered content from assistive technologies only if the act of hiding this content is intended to improve the experience for users of assistive technologies by removing redundant or extraneous content.

https://www.w3.org/TR/wai-aria-1.2/#aria-hidden

关于html - WCAG 2.0 冗余链路,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56119331/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com