views:

37

answers:

2

Hello!

I'm having a simple problem concerning the arrangement of floating divs with variables heights.

The goal:

http://i.imgur.com/yngM5.jpg

The result:

  • see below, can't post more than one link -

I just have div containers with css float: left; and no height defined. The first red circle indicated that my technique fails, although the second one proves me wrong by showing it IS working. Unfortunately, the last (not on screenshots) just starts floating after the height of the previous one (so there's a whole empty space on the left).

How should i solve this?

Thanks!

A: 

I don't think that this is doable a 100% with "just" css, but jquery-masonry should do the trick [ http://desandro.com/resources/jquery-masonry/ ]. Well, but i hope somebody proofs me wrong :)

Hannes
Hey, thanks! Never heard of that. If i can do it with jquery, i'll leave the css :-)
Mathijs Delva
if it works out the way you want ... an Answer accepted and/or up-vote would be much appreciated :D (btw. i use it for my tumblr page, works just dandy)
Hannes
It worked out great, thanks!
Mathijs Delva
A: 

You have two columns. Then code it accordingly:

<div class="column">
    contents of first column
</div>
<div class="column">
    contents of second column
</div>

(you set float:left on the column DIVs)

Šime Vidas
but he has more then 2
Hannes
I have more than 2, but he's talking about the columns Hannes. So this solution WOULD be good, except for the fact that this websites will be a .NET database website which makes the use of static columns a problem. It would be a hassle making the columns fill up with content dynamically. But thanks anyway!
Mathijs Delva
The layout presented in the first image consists of two independent columns.
Šime Vidas
ah, sorry, misunderstood the markup of @Šime Vidas :)
Hannes