下拉不完全可见

时间:2013-03-09 14:06:59

标签: twitter-bootstrap

Dropdown

不幸的是,下拉列表的内容会被删除。

什么是Twitter Bootstrap-to实现菜单打开到左侧而不是右侧(没有手动CSS黑客)?

<div class="btn-toolbar pull-right">
    <div class="btn-group">
        <button class="btn btn-info dropdown-toggle" data-toggle="dropdown">
            Developer <span class="caret"></span>
        </button>
        <ul class="dropdown-menu">
            <li>
                <a href="#">Generate dummy data</a>
            </li>
        </ul>
    </div>
    <button class="btn">Edit</button>
</div>

1 个答案:

答案 0 :(得分:2)

您可以将类pull-right添加到下拉菜单中,如下所示:

Jsfiddle Demo

<div class="btn-toolbar pull-right">
<div class="btn-group open">
    <button data-toggle="dropdown" class="btn btn-info dropdown-toggle">
        Developer <span class="caret"></span>
    </button>
    <ul class="dropdown-menu pull-right"><!-- this is where pull-right is applied-->
        <li>
            <a href="#">Generate dummy data</a>
        </li>
     </ul>
  </div>
<button class="btn">Edit</button>