2014-02-16 28 views
1

我正在使用Zurb基金會5,但我遇到了一個有點奇怪的問題。因爲我想爲兩列使用不同的背景顏色和邊框,所以我需要在它們之間留出空間。 我包括在底部的jsfiddle,但首先代碼:如何在不使用偏移量的情況下在兩列之間的Foundation5網格中添加邊距?

<div class="row"> 
    <div class="small-9 columns content"> 
     The custom CSS is at the bottom of the CSS window. 
    </div> 
    <div class="small-3 columns sidebar"> 
     Edit it to see that the paddings change! 
    </div> 
</div> 

<div class="divider"><p>Space</p></div> 

<div class="row"> 
    <div class="small-8 offset-1 columns content"> 
     The custom CSS is at the bottom of the CSS window. 
    </div> 
    <div class="small-3 columns sidebar"> 
     Edit it to see that the paddings change! 
    </div> 
</div> 

在第二行中,我用「補償」功能,但它給了我在列之間太多的空間。我需要的是一些標準的10到20像素。

有沒有人有一個線索如何管理這與foundation5?我想在這兩列之間有一個靜態的餘量。

http://jsfiddle.net/pXVR3/19/

具有高的問候,

喬治

回答

1

我發現在這個線程的答案: How to add white space between two divs of 6 columns each in foundation 4?

你只需要使用一個包含網格信息的專區內的額外的div像這樣:

<div class="row"> 
     <div class="small-12 medium-8 columns"><div class="content"></div></div> 
     <div class="small-12 medium-4 columns"><div class="sidebar"></div></div> 
    </div> 

現在,您只需將背景顏色應用於網格div並將填充應用於內部div。

謝謝。

相關問題