0

I'm looking for a way to style the parent "footer-wrapper" based on the number of children it has. Please note that I'm not able to change the html and its classes.

<div class="footer-wrapper">
   <div class="content"></div>
   <div class="content"></div>
   <div class="content"></div>
</div>

I've tried:

.footer:first-child:nth-clast-child(3) ~.footer {
   justify-content: space-between;
}

and a few other variations on this theme, but obviously you can't traverse back upward to the parent with this code.

Any help would be very much appreciated.

Thanks,

Temani Afif
  • 245,468
  • 26
  • 309
  • 415
olliemel
  • 3
  • 3
  • You can try using javascript for this. select all elements with content. Find it's length. Toggle class footer-wrapper to new class. – Abhishek Mittal Oct 21 '22 at 09:55

0 Answers0