I am currently working on creating a responsive menu. It is functioning properly, however, I am having trouble implementing an onclick effect in CSS. At the moment, I am using a hover effect. How can I make it so that when the screen width is less than 750px, clicking on the menu in picture number 2 (ul) will display the menu from picture number 3 (li)? This is a one-page site, so when I click on an element from the drop-down menu, it should hide the menu again (li).
HTML:
<header>
<nav id="menu">
<ul>
<li class="li"><a href="#">WITAJ</a></li>
<li class="li"><a href="#">O MNIE</a></li>
<li class="li"><a href="#">DOŚWIADCZENIE</a></li>
<li class="li"><a href="#">CO ROBIĘ?</a></li>
<li class="li"><a href="#">KONTAKT</a></li>
<li><a href="#">MOJE PRACE</a></li
></ul>
</nav>
</header>
CSS:
@media screen and (max-width: 750px) {
header nav#menu ul:hover > li{
display:block !important;
}
header nav#menu ul li{
display:none !important;
}
}