I have the following (simplified) HTML
<ul class="sidenav">
<li class="tree-node">
<a href="url">
<span class="submenu-toggle-container">Text</span>
</a>
<ul class="accordion-menu">
<li class="HideMenu">.......</li>
</ul>
</li>
<li class="tree-node">...</li>
</ul>
I am trying to use CSS to hide the .submenu-toggle-container
span when the sibling is ul li.HideMenu
.
I have been able to make this work using jQuery code
$('ul.sidenav li.HideMenu').parent('ul').siblings('a').children('.submenu-toggle-container').hide();
but this is not optimal for my project and I would much rather use CSS to make this work.
My attempts include
ul.sidenav li.HideMenu ~ ul a .submenu-toggle-container {
display: none;
}
but this does not work.
Any help is appreciated.