I use a slightly modified Soh Tanaka Smart Columns , but in his example all the blocks / columns are the same height. If I have divs with different heights, the technique breaks, as in the following jsfiddle . I donβt like the way DeSandro Masonry handles the height problem because it breaks the blocks depending on the size of the window, so the list loses its implied sequential ordering, so I am exploring another solution.
The solution I'm trying to make is this , but I have a problem trying to clear the sides of the lines / lines. I can use javascript to insert <span style="clear: both;"></span> at the end of each line / line, but this causes more problems when resizing the window and when there are several groups of such smart columns on the same page. Although I'm sure I can write a script to address these cases, I think there might be an easier way.
What is the easiest way to make it such that when a list of floating blocks needs to be wrapped, it should start at the bottom of the highest window in the previous line / line? Only a CSS solution is preferred, but a javascript / jQuery based solution is acceptable.
To rephrase it differently, I want to float in blocks, for example, as "floating" letters of different sizes (letters by default are aligned vertically by default, although for div blocks, the upper alignment probably looks better):

source share