aria-haspopup 有什么作用?
What does aria-haspopup do?
我正在学习如何在 Bootstrap 4 中创建导航栏和下拉菜单,我注意到“aria-haspopup = 'true'”而不是“data-target”属性。你们能解释一下这条线的作用吗?我可以为它使用什么值?这是完整的代码行:
<a class="nav-link dropdown-toggle" href="http://example.com" id="responsiveNavbarDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
aria-haspopup
is not part of Bootstrap 4 but part of the Accessible Rich Internet Applications (WAI-ARIA),W3C 推荐。
根据此建议,aria-haspopup
属性:
Indicates that the element has a popup context menu or sub-level menu.
This means that activation renders conditional content. Note that ordinary tooltips are not considered popups in this context.
A popup is generally presented visually as a group of items that appears to be on top of the main page content.
aria-haspopup
属性和 WAI-ARIA 的总体目标是:
allow assistive technologies to convey appropriate information to persons with disabilities.
aria-haspopup 属性指示可由设置该属性的元素触发的交互式弹出元素的可用性和类型。
我正在学习如何在 Bootstrap 4 中创建导航栏和下拉菜单,我注意到“aria-haspopup = 'true'”而不是“data-target”属性。你们能解释一下这条线的作用吗?我可以为它使用什么值?这是完整的代码行:
<a class="nav-link dropdown-toggle" href="http://example.com" id="responsiveNavbarDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
aria-haspopup
is not part of Bootstrap 4 but part of the Accessible Rich Internet Applications (WAI-ARIA),W3C 推荐。
根据此建议,aria-haspopup
属性:
Indicates that the element has a popup context menu or sub-level menu.
This means that activation renders conditional content. Note that ordinary tooltips are not considered popups in this context.
A popup is generally presented visually as a group of items that appears to be on top of the main page content.
aria-haspopup
属性和 WAI-ARIA 的总体目标是:
allow assistive technologies to convey appropriate information to persons with disabilities.
aria-haspopup 属性指示可由设置该属性的元素触发的交互式弹出元素的可用性和类型。