Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3 col-sm-offset-x affects to the col-md-x structure

I have this code <div class="col col-md-12 col-sm-6 col-sm-offset-1 hidden-xs"> and bootstrap is making the offset to the col-md-12 too, I'm checking the code and I have no clue why this is happening, I think that this wasn't happening before, but I have go back a lot of steps in the code maybe to the point it was working and nothing.

If I remove the offset it works as suppose...but I don't have the offset on smaller resolutions.

This is the page where you can see the problem: Test page

Is the block where it puts "Especial 52º Aniversario"

Thanks for the help, is driving me nuts

like image 569
amibumping Avatar asked May 24 '14 12:05

amibumping


People also ask

What is Col Md offset 3?

offset-md-3 which will offset the desired column element with 3 columns to the right from its default position on medium screen sizes and above. . offset classes always shifts its content to the right. This all stuff produced results .

How do I set Col Md offset in Bootstrap?

An offset is used to push columns over for more spacing. To use offsets on large displays, use the . col-md-offset-* classes.

What is the difference between Col SM and COL MD?

col-sm- (small devices - screen width equal to or greater than 576px) . col-md- (medium devices - screen width equal to or greater than 768px)

What is Col Md offset -*? When we use it?

col-md-offset-* to leave a particular number of virtual Bootstrap columns to the left of any column (kind of like invisible place holders). It is used for giving space from margin-left, you can see in my example first div is used with offset thats why it is displaying from margin left.


2 Answers

The offset applies from sm all the way up to max size. To stop it, add in col-md-offset-0 to prevent the offset applying to larger sizes.

like image 113
DavidG Avatar answered Oct 20 '22 17:10

DavidG


Bootstrap 3 = Mobile first.

Any styles you apply in the xs 'size' range will be carried through to the larger 'sizes' unless you are using the helper utilities like .visible-sm class

If you want to have a one column offset that is visible during the small range only:

    <div class="row">
      <div class="col col-md-12 col-sm-6 col-sm-offset-1 hidden-xs">
        <div class="col-sm-1 visible-sm"><div>
        <div>
          ...continue your content
        </div>
like image 39
bob Avatar answered Oct 20 '22 19:10

bob