问题描述
我目前正在制作导航栏,并且遇到了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
...该指示用于元素的内容,或者还为目标元素指定了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属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!