如何在以下模式中固定Col间距

时间:2019-11-01 15:05:45

标签: twitter-bootstrap bootstrap-4

我在区域和2个按钮之间的间距方面存在问题,就像周围的另一个按钮

iam试图在各个部分和2个按钮之间添加一个空格,并保持形状不变,而这并没有破坏我拥有atm的按钮形状

git的索引格式从187到258,段代码从223234 https://github.com/ahmedabdo97/bootstrap4

<div class="form-group row col-12">
    <div class="btn-group btn-group-toggle" data-toggle="buttons">
        <label class="col-12 col-md-3 mr-auto col-form-label">Sections</label>
        <label class="btn btn-success active  col-md-5">
        <input type="radio" name="non-smoking" id="non-smoking" autocomplete="off" checked> Non-Smoking
        </label>
        <label class="btn btn-danger col-md-4">
        <input type="radio" name="smoking" id="smoking" autocomplete="off"> Smoking
        </label>
    </div>
</div>

实际结果 https://github.com/ahmedabdo97/bootstrap4/blob/master/Screenshot_1.png

1 个答案:

答案 0 :(得分:1)

您的标签未正确组织。尝试添加

<label class="btn btn-success active  col-md-5">
  <input type="radio" name="non-smoking" id="non-smoking" autocomplete="off" checked> Non-Smoking
 </label>
 <label class="btn btn-danger col-md-4">
   <input type="radio" name="smoking" id="smoking" autocomplete="off"> Smoking
</label>

在Div标签中,然后添加.ml-2