I'm trying to create a category dropdown menu with a few columns depending on the length of the <ul>
.
I want to place each submenu item underneath the previous one until the height of the submenu is reached. If so then everything should be placed in a new column.
Something like this:
Main category
|
subcategory1 subcategory3
|subsub1 for subcategroy1 |subsub1 for subcategroy3
|subsub2 for subcategroy1 |
| subcategory4
subcategory2 | etc...
|subsub1 for subcategroy2
|subsub2 for subcategroy2
--------------------------------------------------------------------
// total height of the dropdown
is reached here
I'm using flex-flow
and for that which actually works good. However I can't get my dropdown container to be full-width width a background color.
My HTML looks like this:
<div class="cats">
<ul>
<li class="item sub">
<a title="Baby" href="http://ministry.webshopapp.com/baby/" class="itemLink">Baby</a>
<div class="subnav">
<ul class="flex-wrap">
<li class="subitem title"><a title="Borstvoeding" href="#" class="title">something</a></li>
<li class="subitem"><a title="ATTITUDE" href="#" class="subitemLink">ATTITUDE</a></li>
<li class="subitem"><a title="Apple Park" href="#" class="subitemLink">Apple Park</a></li>
<li class="subitem title"><a title="Borstvoeding" href="#" class="title">something</a></li>
<li class="subitem"><a title="ATTITUDE" href="#" class="subitemLink">ATTITUDE</a></li>
</ul>
</div>
</li>
</ul>
</div>
As CSS is use this:
.cats .subnav {
background: #fff none repeat scroll 0 0;
border: 1px solid #eee;
padding: 30px;
position: absolute;
text-align: left;
z-index: 99;
display:none;
}
.cats .item.sub:hover .subnav {
display: block;
}
.flex-wrap {
background: #fff none repeat scroll 0 0;
display: flex;
flex-flow: column wrap;
height: 200px;
}
.subnav .subitem {
background: #fff none repeat scroll 0 0;
line-height: 36px;
}
SO how can I make .subnav
to fill the background for as much needed?