CSS: subsequent sibling selector (~)

By Xah Lee. Date: . Last updated: .

Subsequent-Sibling Combinator (Has Older Brother X)

aaa ~ bbb

Match all bbb that has a older brother aaa.

Each expression can be compound selector.

/* make list items red, except first */
li ~ li {color:red;}

CSS, Selectors

simple selectors
selector list
relationship selectors (combinators)
special selector
misc