It’s not really clear what the issue is here. Are you saying there’s an empty UL on the page? At any rate, if needed, you could target an element you want to remove visually and set it to display: none, or you could also set it to
I believe the OP is saying he can’t go about id attribute all the time, since it’s unrealistic all menu items will have ids, but he also wants a pure CSS alternative.
From what I understand so far, I really don’t see how this can be done, only by CSS. Unless you do have an id for each menu item, and if you can’t touch the html, then all it’s left is javascript DOM manipulation of some sort to remove the element or javascript id attribute value modification to make the menu item act as a target for a CSS declaration display:none.
It is basically a dead-end, CSS cannot remove any content and what happens when a user agent doesn’t have CSS enabled?
They have done nothing but fiddle with presentation as a hack rather than actually deal with the content itself leading to pointless bloated code. They seriously need to rethink their logic with the program itself.