使用Bootstrap v4-alpha-5证明.btn-group

时间:2016-12-01 09:24:50

标签: twitter-bootstrap twitter-bootstrap-4 buttongroup

问题here解决了<<<阿尔法-3。它在alpha-5中不起作用(我认为在alpha-4中也是如此)。

从我从问题列表中收集到的内容,它已被删除,不会再回来了。

如果这提供了更好的解决方案,我正在使用SCSS和潜在的flexbox。

我想使用toggle-state radio-buttons

<div class="btn-group" data-toggle="buttons">
    <label class="btn btn-primary active">
        <input type="radio" name="options" id="option1" autocomplete="off" checked> Radio 1 (preselected)
    </label>
    <label class="btn btn-primary">
        <input type="radio" name="options" id="option2" autocomplete="off"> Radio 2
    </label>
    <label class="btn btn-primary">
        <input type="radio" name="options" id="option3" autocomplete="off"> Radio 3
    </label>
</div>

有人能提供解决方案吗?

2 个答案:

答案 0 :(得分:2)

<div class="btn-group d-flex" role="group">
   <a href="" class="btn btn-secondary w-100">Previous</a>
   <a href="" class="btn btn-secondary w-100">Next</a>
</div>

阅读https://getbootstrap.com/docs/4.0/migration/#button-group

答案 1 :(得分:0)

如果缺少

,您可以将自定义css添加到您的代码中
.btn-group-justified {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
}
.btn-group-justified .btn,
.btn-group-justified .btn-group {
    float: none;
    display: table-cell;
    width: 1%;
}
.btn-group-justified .btn .btn,
.btn-group-justified .btn-group .btn {
    width: 100%;
}
.btn-group-justified .btn .dropdown-menu,
.btn-group-justified .btn-group .dropdown-menu {
    left: auto;
}
相关问题