I’m having a problem figuring out how to get div 4 to stay the same position when div 1 expands. All the divs are floating left and when I expand div 1 to expand div 2 also expands leaving an empty space between 2 and 4.
I can’t wrap div 1, 3 and div 2, 4 in separate divs

This is the style I use for the divs:
.subcatagory {
float: left;
width: 150px;
}
It’s a problem with float. For this you have to use Js masonry . Other then you have to define your markup like this:
Check this http://jsfiddle.net/XhMtK/1/