Struggling with creating a menu containing nested lists. Attempted using a child selector (#menu-novo li:hover > ul
) to display only immediate descendants, but all are still showing. Any suggestions or solutions for this issue?
#menu-novo-container {
font-family: tahoma, Arial, helvetica, Serif;
border: 1px solid red;
}
#menu-novo {
border: 3px solid green;
}
.menu-novo-item {
border: 3px solid white;
cursor: pointer;
}
.menu-novo-link {
border: 3px solid yellow;
}
.menu-novo-submenu {
border: 3px solid red;
display: none;
}
#menu-novo li:hover > ul {
display: block;
}
.menu-novo-link {
display: block;
}
<div id="menu-novo-container">
<ul id="menu-novo">
<li class="menu-novo-item"> 1
<ul class="menu-novo-submenu">
<li class="menu-novo-item"><a href="#" class="menu-novo-link">1.1</a></li>
<li class="menu-novo-item"><a href="#" class="menu-novo-link">1.2</a></li>
<li class="menu-novo-item"><a href="#" class="menu-novo-link">1.3</a></li>
<li class="menu-novo-item">1.4
<ul class="menu-novo-sumbenu">
<li class="menu-novo-item"><a href="#" class="menu-novo-link">1.4.1</a></li>
<li class="menu-novo-item"><a href="#" class="menu-novo-link">1.4.2</a></li>
<li class="menu-novo-item"><a href="#" class="menu-novo-link">1.4.3</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
Expecting some downvotes since this question may have been asked before, but existing answers aren't solving my problem. Any assistance would be greatly appreciated :)