I would like to apply css (break-inside: avoid;
) to any parent div who has more than x children.
Here is an example:
<div class="section">
<div>Child 1</div>
<div>Child 2</div>
<div>Child 3</div>
</div>
If the section has, for example, less than 4 children I want to use break-inside: avoid;
. Otherwise break-inside: auto;
. I tried with nth-child/last-child without success
Thanks