[英]Must role=“tab” be the direct child of a role=“tablist”?
I have an accordion which is structured like: 我有一个手风琴,其结构如下:
<section... role="tablist">
<div>
<h3 role="tab">Title</h3>
<div role="tabpanel">
...
</div>
</div>
</section>
Does tab have to be a direct child of the tablist to conform to wai aria best practices or is it okay to be wrapped in a div? tab是否必须是tablist的直接子对象才能符合wai aria最佳做法,还是可以将其包装在div中?
Authors MUST ensure elements with role tab are contained in, or owned by, an element with the role tablist.
作者必须确保具有角色选项卡的元素包含在具有角色选项卡列表的元素中或由其拥有。
https://www.w3.org/TR/wai-aria-1.1/#tab
https://www.w3.org/TR/wai-aria-1.1/#tab
Your example is therefore correct. 因此,您的示例是正确的。
I would suggest you read through the spec to ensure you are following best ARIA practice. 我建议您通读规范,以确保遵循最佳ARIA做法。
For example adding the role
on a div
as opposed to a section
element, as per the best practice example . 例如, 根据最佳做法示例 ,在
div
上添加一个与section
元素相对的div
role
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.