gpt4 book ai didi

bootstrap-4 - aria-haspopup 有什么作用?

转载 作者:行者123 更新时间:2023-12-02 07:33:54 24 4
gpt4 key购买 nike

我正在学习如何在 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不是 Bootstrap 4 的一部分,而是 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.

关于bootstrap-4 - aria-haspopup 有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41153573/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com