添加下拉菜单以在引导程序中链接

时间:2014-07-07 00:30:52

标签: twitter-bootstrap drop-down-menu

如何在Bootstrap中为自定义链接添加下拉菜单?通过官方Bootstrap components页面描述如何仅为可点击按钮添加下拉列表而不是自定义链接。

1 个答案:

答案 0 :(得分:9)

不确定这是否是您正在寻找的

<强> Demo

<div class="dropdown">
  <a class="dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
    Link
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
    <li role="presentation" class="divider"></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
  </ul>
</div>