Three Inputs in a Row - Bootstrap 3

2019-09-17 04:37发布

问题:

This is what I have now with Bootstrap 2.

This is what Bootstrap 3 comes up with:

And I have this code:

<div class="row">
   <div class="col-sm-4"><input type="text" class="form-control" /></div>
   <div class="col-sm-4"><select class="form-control"><option value="2">1</option></select></div>
   <div class="col-sm-4"><input type="text" class="form-control" /></div>
</div>

I cannot figure out how to tighten up the inputs so they are like they were in Bootstrap 2.

What do I do?

回答1:

You could tighten up the gutter...

<style>
    .tight-gutter {
        padding: 0 2px;
    }
</style>

<div class="row">
    <div class="col-sm-4 tight-gutter"><input type="text" class="form-control"></div>
    <div class="col-sm-4 tight-gutter"><select class="form-control"><option value="2">1</option></select></div>
    <div class="col-sm-4 tight-gutter"><input type="text" class="form-control"></div>
</div>