隐藏的aria是否足够或将其值设置为"true"?必需的(aria-hidden ="true") [英] Is presence of aria-hidden sufficient or is value set to "true" required (aria-hidden="true")
问题描述
html"hidden"属性是布尔值,不需要设置值.仅仅存在就足够了.
The html "hidden" attribute is a boolean and does NOT need a value set. It's mere presence is sufficient.
隐藏的信息"属性如何?仅仅存在就足够了吗?还是需要设置值为"true"?
What about the "aria-hidden" attribute? Is it's mere presence sufficient? Or does it require the value "true" to be set?
推荐答案
aria-hidden
必须具有true | false的值.但是请注意,如果使用hidden
属性或使用CSS visibility:none
或display:hidden
,则不需要 .后三种隐藏方式中的所有三种也将在屏幕阅读器中隐藏该元素.如果要在屏幕上隐藏一些要从屏幕阅读器隐藏的东西,例如装饰性元素,不会增加页面的含义,则只需要aria-hidden="true"
.
aria-hidden
must have a value of true|false. Note, however, that aria-hidden
is not needed if you are using the hidden
attribute or if you are using CSS visibility:none
or display:hidden
. All three of these latter three ways to hide will also hide the element from a screen reader. You only need aria-hidden="true"
if there's something on the display that you want to hide from a screen reader, such as a decorative element that does not add meaning to the page.
如果要通过将对象的字体大小设置为0或使用剪切矩形来隐藏"对象,或者使用x
或y
将元素推"出屏幕,则将 >需要在该元素上设置aria-hidden="true"
,因为以前的技术只能在视觉上隐藏该元素,而不能真正地隐藏该元素.
If you are "hiding" an object by setting its font size to 0 or using a clipping rectangle or "pushing" the element off the screen with x
or y
, then you will need to set aria-hidden="true"
on that element because the former techniques are only visually hiding the element and not truly hiding the element.
这篇关于隐藏的aria是否足够或将其值设置为"true"?必需的(aria-hidden ="true")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!