does :has respond positively or negatively to display: none. Meaning if you have an element, with display none on it, would :has still see that there is an element present? I assume it would since there is an element there. But I might need to combine it with:
:not([style*="display: none"])
just confirming the behavior
>Solution :
The display property does not change behavior of selectors, as it doesn’t change the DOM tree, so yes it would still work
like if you have
<div>
<p>Hi</p>
</div>
div:has(p) {
background: blue;
padding: 5rem;
}
p {
display: none;
}