I want to place a variable number of HTML lists side by side inside a fixed-sized <div>
element like the following:
+--------------------------------+
| LIST 1 LIST 2 LIST 3 |
| - xxx - xxx - xxx |
| - xxx - xxx |
| - xxx | I need this line break –
| | <-- I don't want LIST 4 to be
| LIST 4 | directly beneath LIST 1!
| - xxx |
| - xxx |
+--------------------------------+
I floated the lists (float: left;
) to get them positioned side by side but I don't know how to avoid that LIST 4 moves up as far as possible (until it is directly beneath LIST 1).
How do I get the vertical space between LIST 1 and LIST 4? Is there any way to use the clear
property elegantly to solve this problem?