Bootstrap 3: Offset isn't working?

David picture David · Mar 21, 2014 · Viewed 150.1k times · Source

I have this code:

<div class="row">
  <div class="col-sm-3 col-sm-offset-6 col-md-12 col-md-offset-0"></div>
  <div class="col-sm-3 col-md-12"></div>
</div>

What I want for small (sm) screens is to have two divs that have three columns each, and an offset of 6 columns for the first div.

For medium (md) screens, I would like to have two divs with twelve columns each (one horizontally stacked under the other), with no offsets.

Somehow the browser doesn't recognize the class col-md-offset-0. It still uses the col-sm-offset-6 class. Any ideas why?

Answer

Overachiever picture Overachiever · Mar 21, 2014

Which version of bootstrap are you using? The early versions of Bootstrap 3 (3.0, 3.0.1) didn't work with this functionality.

col-md-offset-0 should be working as seen in this bootstrap example found here (http://getbootstrap.com/css/#grid-responsive-resets):

<div class="row">
   <div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
   <div class="col-sm-5 col-sm-offset-2 col-md-6 col-md-offset-0">.col-sm-5 .col-sm-offset-2 .col-md-6 .col-md-offset-0</div>
</div>