Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

1/3 Columns With Twitter Bootstrap

I created a custom grid with Twitter Bootstrap 2.0, and I'm trying to figure out how to update the grid to allow me to use 1/3 and 1/2 columns.

It looks like with 1.0 you could just use:

<div class="span-one-third"></div>

Has anyone been able to figure out a way to do something similar with 2.0, or am I overlooking something?

Thanks

like image 349
C Dog Avatar asked Nov 16 '25 20:11

C Dog


1 Answers

The reason Bootstrap used to include span-one-third is that the grid used 16 columns. Today, Bootstrap's grid includes 12 column's (spans) by default. So assuming you haven't customized the grid to use a different number of columns just use the following:

<!-- 3-columns, 1/3 each -->
<div class="row">
  <div class="span4">1/3 width</div>
  <div class="span4">1/3 width</div>
  <div class="span4">1/3 width</div> 
</div>  

<!-- 2-columns, 1/2 each -->
<div class="row">
  <div class="span6">1/2 width</div>
  <div class="span6">1/2 width</div>
</div>  
like image 62
jonschlinkert Avatar answered Nov 19 '25 14:11

jonschlinkert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!