Note that there are some explanatory texts on larger screens.

plurals
  1. POPositioning problems for a grid of boxes in a containing div
    primarykey
    data
    text
    <p>I'm trying to achieve this effect: <a href="http://codepen.io/chriscoyier/pen/wxdCD" rel="nofollow">http://codepen.io/chriscoyier/pen/wxdCD</a></p> <p>I'm using SASS (.sass syntax) and haml, and while everything works with sass/haml in CodePen after I revise the code, it doesn't operate in the same way when I apply it to my app. I would like the boxes to float in a grid within the containing div <code>#notecardContainer</code></p> <p>Unfortunately I just joined and don't have a reputation score high enough to post a picture, which is rather counter-productive. But here's a link: <a href="https://dl.dropboxusercontent.com/u/6910513/Screen%20shot%202013-09-13%20at%209.36.27%20AM.png" rel="nofollow">Screenshot</a></p> <p>Essentially, the boxes are appearing within the containing div <code>#notecardContainer</code>, but they are severely offset to the right by about 50% the width of the containing div <code>#drawer</code> Also, they are stacking vertically, not horizontally, and they don't flex with change in the screen size. I'm not sure why it works in CodePen but not in my code. </p> <p><strong>SASS</strong>: (NOTE: the indentation MAY not translate correctly to StackOverflow)</p> <pre><code>#drawer width: 680px height: auto margin-left: auto margin-right: auto #notecardContainer width: inherit .ul.box position: relative z-index: 1 overflow: hidden list-style: none li position: relative float: left width: 300px height: 150px padding: 0 border: 1px solid #000 margin: 0 30px 30px 0 background: #fff &amp;:before, &amp;:after content: '' z-index: -1 position: absolute &amp;:after left: auto right: 10px </code></pre> <p><strong>HAML</strong>:</p> <pre><code> #notecardContainer %ul.box %li %li %li </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload