aria扩展的html属性 [英] aria-expanded html attribute

查看:226
本文介绍了aria扩展的html属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在制作导航栏,并且遇到了aria-expanded html属性.我当然知道该元素用于让一个元素扩展或折叠.我几乎找不到与此有关的信息,并且 W3C文档帮助那个海事组织不是很清楚.

I am currently making a navbar and came accross the aria-expanded html attribute. I know of course that the element is used to let an element either expand or collapse. I could find very little information with regard to this and the W3C docs aren't that clear IMO.

此属性如何正常工作?

推荐答案

aria-expanded属性只是用户代理的标志.它

The aria-expanded attribute is simply a flag for the user agent. It

指示该元素或它控制的另一个分组元素当前处于展开还是折叠状态.

Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

...该指示用于元素的内容,或者还为目标元素指定了aria-controls .

...where that indication is for the element's contents, or if aria-controls is also specified, for the target element.

您可以设置其值来表明您对页面所做的操作(例如,您已展开或收缩了某个部分).它没有任何与之相关的特定行为,它是用于让用户代理知道正在发生的事情,以便可以向其听众解释(可能有视力障碍并且需要其他指示来表明某节是否存在).展开).

You set its value to indicate what you've done to the page (e.g., you've expanded or contracted a section). It doesn't have any particular behavior associated with it, it's for letting the user agent know what's going on so it can interpret that for its audience (who may be vision-impaired and need some other indication that a section is/isn't expanded).

这篇关于aria扩展的html属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆