如何告诉屏幕阅读器使用属性而不是链接文本? [英] How to tell a screen reader to use an attribute instead of the link text?
本文介绍了如何告诉屏幕阅读器使用属性而不是链接文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在无序列表中有一个链接,如下所示:
I have a link within an unordered list as follows:
<li class="savelink">
<a href="/save"><span>Save</span></a>
</li>
通常,屏幕阅读器会显示保存。
Normally the screen readers read "Save". Is it possible, and with which attribute, to change that without changing the actual link text?
业务需求是要有一个带有图标样式的链接,并且可以通过哪个属性来更改该属性?该图标将作为链接文本的补充。例如:
The business need is to have a link, styled with an icon. The icon will be complementary to the link text. For example:
- +号图标和链接文本菜单的图标,该图标等于添加菜单项
我尝试使用aria标签,但没有成功。
I tried aria-label, with no success.
推荐答案
尝试
< a href = / save ; aria-label = poot> span aria-hidden = true> Save // span // a
<a href="/save" aria-label="poot"><span aria-hidden="true">Save</span></a>
这篇关于如何告诉屏幕阅读器使用属性而不是链接文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文