Muhammed Bhikha Muhammed Bhikha - 1 month ago 7
CSS Question

twitter bootstrap grid system. Spacing between columns

Im sure there is a simple solution to this problem. Basically if I have two columns how can i add a space between them.

eg if the html is :

<div class="col-md-6"></div>
<div class="col-md-6"></div>


The output would simply be two columns right next to each other taking up the whole width of the page. Say the width was set to
1000px
then each div would be
500px
wide.

If I wanted a
100px
space between the two how could I acheive this? Obviously automatically through bootstrap the div sizes would become
450px
each to compensate for the space

Ben Ben
Answer

You can achieve spacing between columns using the col-md-offset-* classes, documented here. The spacing is consistent so that all of your columns line up correctly. To get even spacing and column size I would do the following:

<div class="row">
  <div class="col-md-5"></div>
  <div class="col-md-5 col-md-offset-2"></div>
</div>