<style>
/*
this is not selecting the category container if it doesn't have a child element with a class of category
*/
.category-container:has(>:not(.category)){
background-color:red;
}
</style>
<div class="category-container">
<div class="category"></div>
</div>