按钮组在Bootstrap 2.3.2中证明合理

时间:2013-11-28 05:49:51

标签: twitter-bootstrap

我在bootstrap-3中看到css class btn-group-justified 。有没有办法在bootstrap 2.3.2版本中运行 btn-group-justified ?是的,我怎么能这样做?

2 个答案:

答案 0 :(得分:1)

HTML:    

        <div class="btn-group btn-justified">
            <a class="btn">Left</a>
            <a class="btn">Middle</a>
            <a class="btn">Right</a>
        </div>


    CSS:


    .btn-justified{
        display: inline-block;
        width: 100%;
        float: left;
    }

    .btn-justified .btn{
        display: table-cell !important;
        float: none;
        width: 1%;
    }

答案 1 :(得分:0)

对我来说很好(少):

.btn-group-justified{
    display: table;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;

    >.btn,
    >.btn-group{
        display: table-cell;
        float: none;
        width: 1%;
    }

    >.btn-group{
        .btn{ width: 100%; }
        .dropdown-menu{ left: auto; }
    }
}