I have a set of variable height divs that have been moved to the left. When there are too many specified divs in one line, the next div wraps a new line (as it should). The problem I am facing is that the new line starts at the offset position x in the new line, so the div is under the last div in the previous line, which does not have higher divs behind it - quite often leaving a large margin with the left side.
div.entry { float: left; width: 180px; padding: 10px; }
I essentially want the last div.entry in each "line" (the one that wraps with a new line in front of it) to clear the float, so that the next line of floating divs is aligned with the same height, and do not have a sufficiently large gap on the left side. Illustrated in ASCII:
What I expect:
+-----+ +-----+ +-----+ +-----+ | A | | B | | C | | D | | | | | | | +-----+ +-----+ | | +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ | E | | F | | G | | H | | | | | | | +-----+ +-----+ | | +-----+ +-----+
What is actually going on:
+-----+ +-----+ +-----+ +-----+ | A | | B | | C | | D | | | | | | | +-----+ +-----+ | | +-----+ +-----+ +-----+ +-----+ | E | | F | | | | | +-----+ | | +-----+ +-----+ +-----+ | G | | H | | | +-----+ +-----+
Michael
Jason source share