I want to select only
whose parents have display: block
and exclude those
whose parents have display
If those display
styles are declared inline then you can use the following selectors: div[style*="display: none;"]
(if element has inline style attribute containing "display: none;" then apply style)
Attribute Selectors:
The CSS attribute selector matches elements based on the presence or value of a given attribute.
Src: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
Attribute Contains Selector:
When looking to find an element based on part of an attribute value, but not an exact match, the asterisk character, *, may be used within the square brackets of a selector. The asterisk should fall just after the attribute name, directly before the equals sign. Doing so denotes that the value to follow only needs to appear, or be contained, within the attribute value.
Src: https://learn.shayhowe.com/advanced-html-css/complex-selectors/