After reviewing this example:
https://www.w3schools.com/howto/howto_css_subnav.asp
I am interested in finding a way to hide the submenu when clicked, without relying on Javascript. Is this achievable?
The submenu can be triggered to appear upon hover without the need for JS. The objective is to conceal the submenu once an item within the submenu is clicked. For instance:
https://i.sstatic.net/JfLy0.png
If you select "Package," the entire submenu and red background should disappear.
Amendment 1:
I have tried using :has
and :target
with different combinations to change it to display: none
. Unfortunately, that approach did not yield the desired outcome.