Hello. I want to make sure that when you click on the link, more menu items appear, and then, if you click on this link again, this menu disappears.
Here is the code:
.sub-menu { display: none; } .main-item:focus ~ .sub-menu, .main-item:active ~ .sub-menu, .sub-menu:hover { display: block; } <a class="main-item" href="javascript:void(0);" tabindex="1" >ΠΡΠΊΡΡΡΡ ΠΏΠΎΠ΄ΠΌΠ΅Π½Ρ</a> <ul class="sub-menu"> <li><a href="#1">ΠΏΠΎΠ΄ΠΏΡΠ½ΠΊΡ 1</a></li> <li><a href="#2">ΠΏΠΎΠ΄ΠΏΡΠ½ΠΊΡ 2</a></li> <li><a href="#3">ΠΏΠΎΠ΄ΠΏΡΠ½ΠΊΡ 3</a></li> </ul> And everything would be fine - but when you click on the link, the menu is not hidden. I would be grateful for the help.