Recently, I came across two helpful tip pages that explain how to use :hover to display a drop-down menu and the checkbox to toggle it open or closed.
After implementing it successfully, I encountered an issue with CSS styling. While styling the :hover state was easy, I struggled with styling the opened drop-down menu caused by toggling as there is no direct parent CSS selector for this. Ideally, I prefer not to rely on JavaScript for this solution.
I have included the code I managed to get working on JSfiddle below. Please note that the position of the checkbox is currently not a concern. My code
The particular section at the bottom of the CSS file is where the problem lies.
nav ul li #chktut:checked:parent {
background: #4b545f;
background: linear-gradient(top, #4f5964 0%, #5f6975 40%);
background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%);
background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%);
}