Descendant combinator

noun

say it: “dih-SEN-dunt KOM-bih-nay-ter” /dɪˈsɛndənt ˈkɒmbɪneɪtər/

A space between two selectors, meaning: style the second kind of element only where it sits somewhere inside the first.

What is the descendant combinator?

The descendant combinator is a space between two selectors. It picks elements that sit anywhere inside the first one.

.menu a { text-decoration: none; }   /* links anywhere inside .menu */

In a sentence

  • “With the descendant combinator in .playlist span, every span inside the playlist got smaller, even the ones two levels down.”
  • “The descendant combinator in .menu a styles only the links inside the menu, not the ones in the footer.”
  • “I forgot the space, so .playlistli wasn't a descendant combinator anymore and nothing matched.”

Level: Novice · More CSS terms at this level

Updated