The :empty pseudo-class in CSS | Go Make Things
January 22, 2025
You can use this to target elements that have no children—either child elements or whitespace and text nodes—and style them differently than they would be otherwise.
Sometimes you want to style an empty element, one with no child elements, differently from similar elements that have contents. Well with this relatively new CSS pseudo-class you can.