General sibling combinator

noun

say it: “JEN-er-ul SIB-ling KOM-bih-nay-ter” /ˈdʒɛnərəl ˈsɪblɪŋ ˈkɒmbɪneɪtər/

The ~ sign (tilde) between two selectors, read "any later sibling", that matches every element after another one with the same parent, not only the next.

What is the general sibling combinator?

The general sibling combinator ~ picks every later sibling of an element, not just the next one.

h2 ~ p { color: #555; }   /* every paragraph after the h2, same parent */

In a sentence

  • “With h2 ~ p and the general sibling combinator, every paragraph after the heading turned gray, not only the first one.”

Level: Novice · More CSS terms at this level

Updated