Articles by

Matt DeCamp

Direct link to the article :empty

:empty

The CSS :empty pseudo-class selects any element that does not contain children for a given selector.

/* Changes the background color of every empty section element */
section:empty {
  background-color: tomato;
}

If we were to run that code on …