I am currently working on creating a CSS Main Menu in Vue. The functionality is such that it pops up when the mouse hovers over it, and hides when the mouse moves out. However, I am facing an issue with hiding the menu when clicking on a hyperlink a
. Any suggestions on how to achieve this?
I tried using ".menu a:active { display: none; }", but it did not work as expected.
.menu {
display: none;
}
.menu a {
display: block;
}
.main:hover .menu {
display: block;
}
<div class="main">
<button>Main Menu Title</button>
<div class="menu">
<a>Sub Menu Title</a>
</div>
</div>