I'm a bit stunned by how my UX designer wants things. So I ask here...
We're using bootstrap in our project, and when we use dropdown we are asked to change our menu items from <a href="#" ..
to <button>
instead. Even tho the documentation for bootstraps use <a href ..
https://getbootstrap.com/docs/4.0/components/dropdowns/
我问过UX设计器,它在焦点标签方面存在一些问题,例如。当您浏览元素时。
还有其他令人信服的理由使用<button>
而不是<a href="# ..
答案 0 :(得分:2)
您也可以轻松使用下拉菜单中的按钮:
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<button class="dropdown-item">Action</button>
<button class="dropdown-item">Another action</button>
<button class="dropdown-item">Something else here</button>
</div>
</div>