所以以下内容:
<span class="uxf-icon uxf-search"></span>
和:
.uxf-search::before { content: ";" }
所以屏幕阅读器实际上会读出“分号”.有没有办法阻止它这样做?我理解这个说法:没有CSS标签实际上不起作用!
解决方法
Font Awesome使用与您的示例相同的技术,并且仅针对您引用的问题引起了一些抨击.因此,Font Awesome came up with an accessibility page可能对您有用.
如果您的图标仅用于装饰,而不是用于传达信息,那么FA辅助功能页面中的这一部分代码可能对您有用:
Icons used for pure decoration or visual styling
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.
<i class="fa fa-fighter-jet" aria-hidden="true"></i>
an icon being used as pure decoration
<h1 class="logo"> <i class="fa fa-pied-piper" aria-hidden="true"></i> Pied Piper,A Middle-Out Compression Solution Making Data Storage Problems Smaller </h1>
an icon being used as a logo
<a href="https://github.com/FortAwesome/Font-Awesome"><i class="fa fa-github" aria-hidden="true"></i> View this project's code on Github</a>
an icon being used in front of link text
与往常一样,测试真实用户并确保图标的缺失不会损害页面的含义(在测试中将其隐藏于有视力的用户并查看其缺失是否令他们感到困惑).
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。