Well, if you really need to use float
declarations, you have two options:
clear: left
on the leftmost items - the con is that you'll have a fixed number of columnsheight
- either by script or by hard-coding the height in the CSSBoth of these are limiting, because they work around how floats work. However, you may consider using display: inline-block
instead of float
, which will achieve the similar layout. You can then adjust their alignment using vertical-align
.