CSS :empty Selector - Ronalds Vilcins - Medium

PHOTO EMBED

Thu Apr 21 2022 06:03:45 GMT+0000 (UTC)

Saved by @alexmwalker

/* Background color of every empty div element */
div:empty {
  background-color: #000;
}
<div>
  <p>Some text</p>
</div>
<div>
  <!-- No text, background #000 -->
</div>
content_copyCOPY

https://vilcins.medium.com/css-empty-selector-d027b3b2cc48