I have an issue with creating a hoverable dropdown menu. If I take away the second part of my statement in my hover ( .dropMenu
) the hover function works on the header button, so I know it's not an issue there. I'm extremely stuck, and cannot see any issues. Here is my code:
.dropMenu {
display: none;
flex-direction: column;
align-items: center;
margin-left: -18px;
}
.drop:hover .dropMenu{
display: flex;
}
<nav id="nav">
<a href="HTMLRef1.html">Home</a>
<a href="#" class ="drop">Hover Dropdown</a>
<a href="#" >Contact</a>
</nav>
<div class="dropMenu">
<a href= "#">MenuItem1 </a>
<a href= "#">MenuItem1 </a>
<a href= "#">MenuItem1 </a>
</div>
The header button that says "DropDown Content" has a class of drop
. The actual dropdown menu has a class of dropMenu