Struggling to make a class visible when hovering over its parent class in CSS? Want to activate the submenu class on hover effect over the menu class? Here is the HTML code:
<li class="menu"><a href="#">Link</a></li>
<ul class="subMenu">
<li><a href="#">Link A</a></li>
<li><a href="#">Link B</a></li>
<li><a href="#">Link C</a></li>
</ul>
Here is the CSS code:
.subMenu
{
display:none;
visibility:hidden;
}
.menu:hover .subMenu
{
display:inherit;
visibility:visible;
}
If you're having trouble with the hover effect, it may need some adjustments.