我有一个普通的表单(Twitter引导,而不是内联),但是一个输入字段在它旁边有一个按钮(见下面的图)。所有输入字段的顶部都有一个标签。
什么是正确的引导语法(最好不用添加我自己的CSS)有一个内联表单组(输入字段和它旁边的按钮),标签不是内联的(即位于输入字段的上方)?
<form>
  <div class="form-group">
    <label for="mobile">Mobile</label>
    <input type="text" class="form-control" />
  </div>
  <div class="row">
    <div class="col-xs-8">
      <div class="form-group">        
        <label for="coupon">Coupon</label> <!-- should behave like the other non-inlined form fields -->
        <input type="text" class="form-control" />
      </div>
    </div>
    <!-- should be inline aligned with the input field -->
    <div class="col-xs-4">
      <button class="btn btn-primary">Apply</button>
    </div>
  </div>  
</form>

发布于 2016-08-18 20:47:57
这里你有一个小提琴,如果你不希望它的中心与保证金。您可以在这些div中添加另一个类,这样就不会更改所有默认的引导样式,但这只是为了向您展示如何做到这一点。
.col-xs-7, .col-xs-4{
  display:inline-block;
  float:none;
}https://stackoverflow.com/questions/39026998
复制相似问题