The hierarchy of CSS selection is like a one-way street in a tree structure. Once you reach the children elements, you lose the ability to target the parent element.
If you want to determine if all the children elements are hidden or not, you must inspect each child element for the display: none;
property. One way to select all hidden children is using the following syntax:
<parent tag> *[display=none]
. However, there isn't a straightforward method to confirm whether
all children are hidden and it's challenging to go back and select the parent element after identifying the hidden children.
To address this issue, you will have to utilize JavaScript. Check out this Stack Overflow thread for more information: Check if all children elements are hidden