2015-11-04 61 views
1

我具有基於超對稱網格的網頁,與內容是這樣的:與Susy堆棧內容每

<div class="container"> 
    <div class="column-gallery-item"> 
    <p>Who's down there? Can't see!</p> 
    </div> 
    <div class="column-gallery-item">  
    <p>Lots<br>and lots<br>and lots<br>of content</p>  
    </div> 
    <div class="column-gallery-item"> 
    <p>Not much here</p> 
    </div> 

    <div class="column-gallery-item">  
    <p>I want to move up!</p>  
    </div> 
</div> 

每個div跨越12列網格的4列。前三div小號出現在一行中,最後div移動到下一行 - 看http://codepen.io/anon/pen/meGJVp

現在我需要的最後一個div拉昇,正下方的第一個。我該怎麼做?

+0

可能重複:HTTP: //stackoverflow.com/questions/20307386/masonry-layout-in-css3 – cimmanon

+0

普遍的問題有相似,但我的問題是具體到與Susy。 – gummbahla

+0

與Susy沒有魔力,它編譯到CSS到底。在不修改標記的情況下,你無法得到你想要的東西。 – cimmanon

回答

1

如果你想要的項目堆放在網格中的第一項,那麼唯一的辦法就是窩它在同一列下:

<div class="column-gallery-item-stacked"> 
<div class="nested-column-gallery-item"> 
    <p>Who's down there? Can't see!</p> 
</div> 
<div class="nested-column-gallery-item">  
    <p>I want to move up!</p>  
</div> 
</div> 

在這裏看到:http://codepen.io/anon/pen/QjVjMK