Basically, I expect the code to hide everything with an id of menu-main, but not hide the list elements with a class of lms. My corresponding html looks like:
when you hide #main-menu all its children are hidden, regardless of their display value.
This should work (hide all <li>s but show the ones with class “lms”):
#menu-main li {
display:none;
}
#menu-main .lms {
display:block;
}
PS. Don’t overdo it with selectors, there is only one #menu-main, so you can just use that in css, no need to also add .menu to it, that just forces the browser to do an additional check for nothing. Similarly, since all items with class “lms” are <li>s (right?) there is no need to define li.lms, but just .lms
are still hidden and I need these guys to show as well. One solution that works is that I can just add a class of “lms” to each of these li’s. However, might there be a “cleaner” solution?