JTunney
JTunney

Reputation: 904

Bootstrap 3 - Single column in a row, but not col-md-12

All of my input fields are width=100% so they fill 100% of whichever column they are in. Lets say I have a page that only needs 1 column but I don't want I don't want my fields going across the entire page (i.e. col-md-12). Instead, I would rather do something like this:

<div "class=container-fluid">
   <div class="row">
      <div class="col-md-4"></div>
   </row>
</div>

I thought you were always supposed to fill all 12 columns with bootstrap so it feels strange only doing one column of 4, but if I want the width of my form to be 4 then this is what I need to do. Should I even be using the bootstrap grid system on pages that don't need more then 1 column?

Upvotes: 0

Views: 3395

Answers (1)

Seyong Cho
Seyong Cho

Reputation: 1087

You can add clearfix below the col-md-4.

<div class="clearfix"></div>

You don't really have to fit all 12 columns...

Some of their examples don't even fill up all 12 columns.

http://getbootstrap.com/css/#grid-example-wrapping

Upvotes: 2

Related Questions