咏叹调隐藏在字体真棒中的作用 [英] Effect of aria-hidden in Font Awesome
问题描述
what's the effect of aria-hidden
in Font Awesome?
Is it necessary to use it? why? or why not?
例如,我想在下面的代码中了解aria-hidden="true"
的效果:
for example, I want to know the effect of aria-hidden="true"
in the code below:
<i class="fa fa-star" aria-hidden="true"></i>
推荐答案
简而言之,它使屏幕阅读器看不见该图标,从而增强了可访问性.
In short, it makes the icon not visible to screen readers, to enhance accessibility.
来自文档:
如果您使用图标来添加一些额外的装饰或品牌,则无需在用户浏览您的网站或应用程序时向用户宣布该图标.此外,如果您使用图标在视觉上重新强调HTML或为HTML中已经存在的内容添加样式,则无需对使用辅助技术的用户重复使用该图标.您可以通过将aria-hidden ="true"添加到您的Font Awesome标记中来确保不会被读取.
If you're using an icon to add some extra decoration or branding, it does not need to be announced to users as they are navigating your site or app aurally. Additionally, if you're using an icon to visually re-emphasize or add styling to content already present in your HTML, it does not need to be repeated to an assistive technology-using user. You can make sure this is not read by adding the aria-hidden="true" to your Font Awesome markup.
这篇关于咏叹调隐藏在字体真棒中的作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!