I am trying to make a nested menu with CSS and struggle so much to get this working, I have my attempt here but cannot get further. Is there something I'm doing wrong and if so, can someone explain how the CSS works in these cases...This is a dynamically produced menu...
I can't get the submenus to work accordingly and no matter how much I google and search I can't get mine to work as the others! :)
Any help is appreciated!
#category_list {
display: flex;
justify-content: space-evenly;
list-style-type: none;
padding: 8px;
background-color: azure;
}
.dropdown .submenu {
display: none;
list-style-type: none;
}
.dropdown:hover .submenu {
display: block;
list-style-type: none;
background-color: antiquewhite;
}
#category_list .dropdown .submenu:hover {
display: block;
}
#category_list .dropdown .submenu .dropdown .submenu {
display: none;
padding: 20px;
}
<ul class=category_list>
<li class="dropdown">
Computer Equipment
<ul class="submenu">
<li class="dropdown">
Computer Parts
<ul class="submenu">
<li>
<a href="categoryPage.html?categoryId=3">MotherBoard</a>
</li>
<li>
<a href="categoryPage.html?categoryId=3">Power Supply</a>
</li>
<li>
<a href="categoryPage.html?categoryId=3">Graphic Card</a>
</li>
<li>
<a href="categoryPage.html?categoryId=3">Processor</a>
</li>
<li>
<a href="categoryPage.html?categoryId=3">Memmory</a>
</li>
<li>
<a href="categoryPage.html?categoryId=3">Computer Case</a>
</li>
</ul>
</li>
<li>
Storage
<ul>
<li>
<a>SSD</a>
</li>
<li>
<a>Hard drive</a>
</li>
</ul>
</li>
<li>
Network
<ul>
<li>
<a>Router</a>
<a>Switch</a>
<a>Network Cable</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>