Note that there are some explanatory texts on larger screens.

plurals
  1. POadding an element in between a row of floated elements
    primarykey
    data
    text
    <p>I have a bunch of boxes that are aligned in a grid.</p> <p>They are all floated to the left, and then margin and width of one box is about 33%, so that once three boxes are next to each other, the next boxes are going in the next row. fairly even thirds.</p> <p><strong>This is what i start with:</strong> <img src="https://i.stack.imgur.com/xkqlN.png" alt="Start"></p> <p>when clicking on a box i now would like to add a box under the box i clicked on.</p> <p>i want to see it happening in a manner where pretty much just the space between the row of boxes is increased, and the new box is squeezed into that space.</p> <p><strong>This is what i would like to see:</strong> <img src="https://i.stack.imgur.com/GxXhN.png" alt="desired goal"></p> <p>currently i simply use jquery's <code>.after()</code> to add a box after the box i clicked on. this box has <code>clear:both;</code> and it will work perfectly, but ONLY when clicking on the third box... when i click on the second or first box, the following boxes of the same row are floated into the next row. <em>of course that's totally predictable, because it does exactly what i told it to do.</em> <strong>but i want them to stay there! i just dont know how.</strong></p> <p><strong>This is what i get instead:</strong> <img src="https://i.stack.imgur.com/dZaHv.png" alt="the problem"></p> <p><strong>what would be the best way to accomplish this?</strong></p> <p>Here is an example of my code: <a href="http://jsfiddle.net/z3ggf/1/" rel="nofollow noreferrer">http://jsfiddle.net/z3ggf/1/</a></p>
    singulars
    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.
 

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