How to do a three column grid with bourbon neat?

折月煮酒 提交于 2019-12-12 03:56:54

问题


I'm trying to create a three column grid, and have the columns evenly distributed across the row.

My markup is simple:

<div class="row">
  <div class="col">
  </div>
  <div class="col">
  </div>
  <div class="col">
  </div>
  <div class="col">
  </div>
  <div class="col">
  </div>
  <div class="col">
  </div>
</div> 

My scss is also pretty straight-forward.

 .row {
    @include outer-container ;
  }
 .service {   
    @include span-columns(4) ;
}

However the result is a mess:

That's close to what I want. But the blocks are all over the place. They aren't evenly distributed either horizontally or vertically.

What could be going on here? How can I get a simple three-column grid with even distribution of blocks?


回答1:


You would need to use the omega mixin here. Try this:

.row {
    @include outer-container ;
  }
 .service {   
    @include span-columns(4);
    @include omega(3n);
}

Some more information here:

http://thoughtbot.github.io/neat-docs/latest/#omega



来源:https://stackoverflow.com/questions/42218310/how-to-do-a-three-column-grid-with-bourbon-neat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!