Is it possible to apply style to a parent element if child is not empty? I need to remove border from empty container.
.parent {
border: 1px solid #ccc;
padding: 10px;
margin: 20px;
}
<div class="parent">
<div class="child">
not empty
</div>
</div>
<div class="parent">
<div class="child">
</div>
</div>
I've tried:
.parent:not(> .child:empty)
but cleaerly this is going to look for .child class inside .parent... Is there a way to do it with CSS?