我开始研究移动可访问性,有一种行为让我觉得很奇怪。当我在超链接中放置SPAN或DIV时,屏幕阅读器会读取所有内容两次。这不是我在桌面上使用ChromeVox或NVDA的行为。
下一页
<html>
<head>
<style>
.title { font-weight: bold; }
</style>
</head>
<body>
<a href="https://www.google.com">
<span class="title">Some title</span>
<span class="description">Some description</span>
</a>
</body>
</html>当我的手机读到这一页时,我得到以下信息:
一些标题,一些description
我已经试过了下面的食谱,但我觉得太过分了:
<a href="https://www.google.com" aria-label="Some title Some description">
<span class="title" aria-hidden="true">Some title</span>
<span class="description" aria-hidden="true">Some description</span>
</a>有什么简单的方法让语音助理只读一次课文吗?
发布于 2021-02-08 16:24:42
移动屏幕阅读器倾向于单独浏览每个部分,因此这在某种程度上取决于辅助技术行为。要直接解决这个问题,可以将role="text"添加到每个span标记中,以获得您想要的行为。
但是,如果您有很多与同一问题的链接,这可能仍然是不切实际的。我不太确定,但看起来你可能最终会有一些很长的链接,这对于可访问性来说并不理想。只尝试嵌套元素中的重要文本。如果您需要使可单击区域更大,请尝试使用另一种技术,如z-index,或此处建议的技术- https://inclusive-components.design/cards/#thepseudocontenttrick。
另见https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-in-context.html
https://stackoverflow.com/questions/65783671
复制相似问题