Hide text ONLY for screen readers

江枫思渺然 提交于 2020-01-05 09:07:34

问题


I simply can't get the answer to this question. The WCAG says it can be done by aria-hidden tag, but I've read it's not working at many screen readers.

Can't get how display:none can help to hide some text only for screen readers(=visible to other devices than SR). This is also not clear how would screen reader act for display:none if it not supports css.

Is there any technique or best practice or whatever I can use to hide some text only for screen readers?


回答1:


aria-hidden should be used to hide any non-focusable content on a page from screen readers. All major screen readers current versions support this well.

In oder to satisfy WCAG 2 AA, a feature only needs to be supported on the common or at least one widely distributed free assistive technology. NVDA and Firefox on Windows, VoiceOver on OS X and iOS and Talkback with Firefox on Android all support this feature.




回答2:


Sorry, the best practice is to use aria-hidden attribute. Users with screen readers ignoring ARIA attributes should change their software.




回答3:


You can also use role="presentation", depending of the tag, browser and screen reader it can be a better option (or worse). Take a look at this good tutorial,

HTML5 Accessibility: aria-hidden and role=”presentation”



来源:https://stackoverflow.com/questions/34963409/hide-text-only-for-screen-readers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!