css - 引导下拉菜单不使用可用空间并在向右拉时中断

标签 css twitter-bootstrap-3 angular-ui-bootstrap

我的下拉菜单是这样的:

<a uib-dropdown-toggle class="tm-notification" href="">
    <i class="tmn-counts" id="idItemNumber">666</i>
</a>
<div class="dropdown-menu pull-right dropdown-menu-lg">
    <div class="listview">
        <div class="lv-header">
            A title here
        </div>
        <div class="lv-body c-overflow">
            <div class="lv-item">
                <div class="lv-title">
                    <div class="pull-left">Some very long text here</div>
                    <div class="pull-right">01-06-2016</div>
                </div>
            </div> 
        </div>
    </div>
</div>

这导致 pull-right div 跳到下一行。

enter image description here

我不确定这些 css 类中有多少是标准 Bootstrap ,但是 dropdown-menu div 的 css 有:

min-width: 300px;

如果我添加 width: 345px; 结果是正确的,但它不再是动态的。 所以我希望下拉菜单的宽度取决于其内容。

我试图将所有数据放在 1 个向左拉的 div 中

<div class="pull-left">Some very very long text here 01-01-2016</div>

宽度 react 正常,但我没有正确调整日期。

最佳答案

试试这个

<a uib-dropdown-toggle class="tm-notification" href="">
    <i class="tmn-counts" id="idItemNumber">666</i>
</a>
<div class="dropdown-menu pull-right dropdown-menu-lg">
    <div class="listview">
        <div class="lv-header">
            A title here
        </div>
        <div class="lv-body c-overflow">
            <div class="lv-item">
                <div class="lv-title">
                    <div class="pull-left col-sm-7">Some very long text here</div>
                    <div class="pull-right col-sm-5">01-06-2016</div>
<div class="clearfix"></div>
                </div>
            </div> 
        </div>
    </div>
</div>

关于css - 引导下拉菜单不使用可用空间并在向右拉时中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39038521/

相关文章:

css - 为什么 Bootstrap 标 checkout 现在错误的地方?

javascript - 有条件地使用 ng-class 应用引导列

css - 在 Twitter Bootstrap CSS 中为背景图像覆盖 `background: transparent !important`

twitter-bootstrap - 如何更改特定框(ID)中的弹出窗口宽度

css - react 虚拟化 : Collection with cells that have the same fixed height but different widths

javascript - Angular UI Typeahead - 防止下拉菜单在选择时关闭

angularjs - 如何在 ionic Angular 待办事项示例中清除模态

jquery - css水平下拉导航菜单

html - 网页加载时跳到底部,不知道为什么,可能是什么原因造成的?

html - CSS 列表样式具有随机空间