0

I have this css:

div.row {
  @include outer-container; 
  div.col-5 { @include span-columns(5); }
  div.col-6 { @include span-columns(6); }
}

And this html:

<div class="jobs row">
  <div class="col col-6">Front End Developer</div>
  <div class="col col-6">Front End Developer</div>
  <div class="col col-6">Front End Developer</div>
</div>

I want maximum of 2 divs per line.

However, instead of displaying the first 2 col divs side by side, and then the third one on the second line to the left, the first div remains on the first line alone, and the other 2 fall below side by side.

And if I change the class of the second div to col-5 for example, then they line up correctly.

Why aren't they just falling normally, as when using bootstrap cols inside a row for example?

dzimi
  • 769
  • 3
  • 10
  • 20

2 Answers2

0

I'm not an expert on bourbon neat. but based on first look each row has 12 columns so if you want 3 divs to align in same row you may have to do 12/3=4. So your html should be like

CSS

div.row {
  @include outer-container; 
  div.col-6 { @include span-columns(6); }
}

HTML

<div class="jobs row">
  <div class="col col-6">Front End Developer</div>
  <div class="col col-6">Front End Developer</div>
  <div class="col col-6">Front End Developer</div>
</div>
Umamaheswaran
  • 3,690
  • 3
  • 29
  • 56
0

You need to use the omega mixin. Try this:

HTML

<div class="jobs row">
  <div class="col col-6">Front End Developer</div>
  <div class="col col-6">Front End Developer</div>
  <div class="col col-6">Front End Developer</div>
</div>

SCSS

div.row {
  @include outer-container; 
  div.col-6 { 
    @include span-columns(6); 
    @include omega(2n);
  }
}
Mike Harrison
  • 1,020
  • 2
  • 15
  • 42
  • thanks, can you have a look here as well? http://stackoverflow.com/questions/35660418/burbon-neat-shift-have-the-right-element-on-top-instead-of-the-left-one – dzimi Mar 12 '16 at 23:20