Articles by

Matt DeCamp

: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 …

Avatar of Geoff Graham
Geoff Graham on

object-position

The CSS property object-position is used to align any selected replaced element (e.g., an <img>) within the box that contains it.

img {
  object-position: right bottom;
}
Avatar of Matt DeCamp
Matt DeCamp on (Updated on )