开发者

Float divs with variable heights (arrange)

I'm ha开发者_C百科ving a simple problem concerning the arrangement of floating divs with variables heights.

The goal:

Float divs with variable heights (arrange)

The result:

Float divs with variable heights (arrange)

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!


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 :)


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜