0
使用Foundation和Rails定義默認網格的最佳方式是什麼?它將檢查一行中的項目數並拉動列來維護網格佈局?在Rails中定義默認的基礎網格,將拉動列
例如,我要一個默認的佈局是3×3等於在總共9個項目我可能會做這樣的事情:如果我有整整9個項目我認爲會使這樣
<% @jobs.in_groups_of(3, false) do |row| %>
<div class="row">
<% for job in row %>
<div class="large-4 columns>
<div class="panel">
<% job.address %>
<% job.state %>
<% job.postcode %>
</div>
</div>
<% end %>
</div>
<% end %>
:
<div class="row">
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
</div>
<div class="row">
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
</div>
<div class="row">
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
</div>
通常發生的是,雖然這意味着不是9個項目你結束了7或8,你必須開始添加拉班到最後一個項目 - 這樣的事情:
<div class="row">
<div class="large-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
<div class="large-4 pull-4 columns>
<div class="panel">
219/32 Makenzie Island Squares
SCHUPPEMOUTH, MASSACHUSETTS
44753
</div>
</div>
</div>
或者: