I'm a bit stumped. I'm trying to create a simple menu structure using parent/child un-ordered lists. I've run into a road block trying to figure out the css needed to achieve the menu display listed in the image below:
Here is an example html menu structure
<div class="container-div">
<ul class="level1">
<li>Item
<ul class="level2">
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</li>
<li>Item
<ul class="level2">
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</li>
<li>Item
<ul class="level2">
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</li>
<li>Item
<ul class="level2">
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</li>
<li>Item
<ul class="level2">
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</li>
<li>Item
<ul class="level2">
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</li>
</ul>
</div>
As you can see the level 1 <ul>
has 6 <li>
items of varying heights depending on the contents on the level 2 <ul>
.
For some reason, I'm completely drawing a blank on how to achieve this display effect with css. display:inline-block;
won't work, as <li>
numbers 5 and 6 would just display on a new line, with lots of empty space below <li>
2, 3, and 4.