Search code examples
csssasssusy

Susy stack content per column


I have a webpage based on a susy grid, with content like this:

<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>

Each div spans 4 columns of a 12-column grid. The first three divs appear in a single row, the last div moves to the next row - see http://codepen.io/anon/pen/meGJVp .

Now I need the last div to move up, directly below the first one. How can I do so?


Solution

  • If you want the item to stack underneath the first item in the grid then the only way is to nest it in the same column:

    <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>
    

    See here: http://codepen.io/anon/pen/QjVjMK