在浏览了一些谷歌和其他 SO 文章后,我决定简单地提出我的问题,希望得到一个简单、直接的答案。
为讨论添加进一步的步骤opacity:0 与visibility:hidden 的效果完全相同吗 https://stackoverflow.com/questions/272360/does-opacity0-have-exactly-the-same-effect-as-visibilityhidden: 我明白那个display:none
and visibility:hidden
隐藏屏幕阅读器等的元素,但是怎么样opacity:0
?
链接问题的答案之一中的表格指出不透明度参与taborder,那么这是否必然意味着它将是映射到辅助功能 API http://www.w3.org/1999/xhtml/vocab/#presentation?
设置一个巨大的负值text-indent
通常作为替代品提供display: none
and visibility: hidden
对于下拉菜单,但我想在没有 JavaScript 的情况下淡入和淡出菜单,同时确保不会对屏幕阅读器隐藏它们。
虽然这是一个较老的问题,但它是 Google 搜索中最早出现的问题之一,所以我想插话一下。
截至 2017 年 4 月,ChromeVox 屏幕阅读器无法读取不透明度设置为 0 的内容。
具体来说,ChromeVox 不会读取不透明度设置为零的视觉隐藏文本,除非该元素由视觉上可用的文本标记。
例如:
<!-- will not be read -->
<a href="#!" style="opacity: 0;">not read</a>
<!-- WILL be read -->
<a href="#!" style="opacity: 0.001;">is read</a>
<!-- span text will not be read -->
<a href="#!">
Read More
<span style="opacity: 0;">
this will not be read
</span>
</a>
<!--
button text will not be read,
but aria-labelledby text will be read on button focus
-->
<span id="test">button label</span>
<button type="button" aria-labelledby="test" style="opacity: 0;">
This text will not be read
</button>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)