添加ARIA标签后,屏幕阅读器无法阅读
我添加了Aria-Label,但仍无法阅读第1 div的警告。 重点是第1 div,但不读任何东西。如何告诉屏幕阅读器阅读Waring Icon?
<div aria-label="Warning for" class="col-xs-1 color-red-1 hbmi-warning m-t-2"></div>
<div class="col-xs-10 p-l-1x p-r-unset">Deductible Amount</div>
I have Added aria-label but still Screen Reader not able to read Warning for which is 1st div .
focus goes on 1st div but not reading anything. How to tell screen reader to read warining icon ?
<div aria-label="Warning for" class="col-xs-1 color-red-1 hbmi-warning m-t-2"></div>
<div class="col-xs-10 p-l-1x p-r-unset">Deductible Amount</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
aria-label
主要用于交互式元素,尽管aria-label
的文档并未具体说明。该文档讨论了您可以可靠地使用它的元素, https://www.w3.org/tr/usish-ria/#practical-support-aria-aria-aria-rabel-aria-aria-labelle-labelledby-and-aria-descriped 。第三个子弹点说:
span
或div
上使用aria-label或aria-labelledby。我不会在
&lt; div&gt;
上随机将角色
,尤其是alert
之类的东西。您要实现什么行为?
div
错误图标吗?您是否希望屏幕读取器用户找到此
div
?这不是交互元素。aria-label
is mainly to be used on interactive elements, although the doc foraria-label
doesn't specifically say that.This doc talks about elements you can reliably use it on, https://www.w3.org/TR/using-aria/#practical-support-aria-label-aria-labelledby-and-aria-describedby. The third last bullet point says:
span
ordiv
unless its given a role.I would not randomly throw a
role
on the<div>
, especially something likealert
.What behavior are you trying to achieve?
Is the
div
an error icon?Do you want screen reader users to find this
div
? It's not an interactive element.