The best way to explain this is with the below image. You can see I have 3 divs floated left with a fixed width but variable height.
When I add a 4th I would like it to slot underneath the 2nd div because there is space available.
I would like all following divs to use the space as efficiently as possible, slotting in where they can.
I saw a jQuery plugin achieve this once, but I don’t know what the technique is called so I cannot find it!

Thank you.
There is a great plugin for that – jquery masonry.