gpt4 book ai didi

html - Font Awesome 中 aria-hidden 的效果

转载 作者:技术小花猫 更新时间:2023-10-29 12:53:17 24 4
gpt4 key购买 nike

aria-hidden 在 Font Awesome 中有什么作用?有必要用吗?为什么?或者为什么不呢?

比如我想知道下面代码中aria-hidden="true"的效果:

<i class="fa fa-star" aria-hidden="true"></i>

最佳答案

简而言之,它使屏幕阅读器看不到图标,以增强可访问性。

来自 the documentation :

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.

关于html - Font Awesome 中 aria-hidden 的效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44692917/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com