Frost
Frost
KPCKevin Powell - Community
Created by Frost on 12/20/2023 in #front-end
How to select an element that doesn't have a child or contains a particular element
it's working now, thanks!
8 replies
KPCKevin Powell - Community
Created by Frost on 12/20/2023 in #front-end
How to select an element that doesn't have a child or contains a particular element
<style>
.category-container:has(>:not(.category)){
background-color:red;
}
</style>

<div class="category-container">
<div class="category"><span>test</span></div>
<div><span>test</span></div>
</div>
<style>
.category-container:has(>:not(.category)){
background-color:red;
}
</style>

<div class="category-container">
<div class="category"><span>test</span></div>
<div><span>test</span></div>
</div>
it is only working when the container element only contains a one div but when i add another div it's not matching the container element.
8 replies
KPCKevin Powell - Community
Created by Frost on 12/20/2023 in #front-end
How to select an element that doesn't have a child or contains a particular element
it's still not working i don't know why
8 replies