I arrange multiple boxes (divs) in two columns using float:left for all of them. The divs have different heights, resulting in a layout like this:
AAA BBB
AAA BBB
AAA
AAA CCC
CCC
CCC
CCC
But I want to define a minimal height (minimum available space), when a box must float in the left column. I want a result similar to this:
AAA BBB
AAA BBB
AAA
AAA
CCC
CCC
CCC
CCC
I suppose that is not possible … but however maybe there is a CSS trick?
Use a floated element above a cleared element that has a large negative margin to control the float alignment. The browser should increase the top margin of a cleared element so that it clears the float. Therefore the massive top negative margin is recomputed by the browsers so that the element just clears the float:
Conversely, a height limit cannot be used to control float drop, but a width limit can:
References