The element~element selector or general sibling combinator is made of the "tilde" character that separates two sequences of simple selectors. The elements represented by the two sequences share the same parent in the document tree and the element represented by the first sequence precedes (not necessarily immediately) the element represented by the second one.

element1~element2 {
    css declarations;
}
div~p {
   color: #3366ff;
   background: #ffff99;
}

Click the button below to experiment with this selector.

Give it a Try!

YesFirefox YesExplorer YesChrome YesSafari YesOpera