咏叹调隐藏在字体真棒中的作用 [英] Effect of aria-hidden in Font Awesome

查看:76
本文介绍了咏叹调隐藏在字体真棒中的作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆