Is there a way to use the same class, like .outer
, for both divs but with different styling for the parent element when there are more than two children?
Kindly refer to the example provided below:
.outer1{
border: solid 6px #f00;
}
.outer2{
border: solid 6px #ccc;
}
<p>More than two children:</p>
<div class="outer1">
<div class="div1">div1</div>
<div class="div2">div2</div>
<div class="div3">div3</div>
</div>
<p>Just two children:</p>
<div class="outer2">
<div class="div1">div1</div>
<div class="div2">div2</div>
</div>