CSS3 element1~element2 Selector
Complete CSS Selector Reference Manual
Example
Set the background color of every ul element that follows a p element with the same parent:
p~ul
{
background:#ff0000;
}
Try it »
Definition and Usage
element1~element2 The selector matches element2 that appears after element1.
element1 and element2 Both elements must have the same parent, but element2 element2 does not have to immediately follow element1 element1.
Browser support





All major browsers support element1~element2 selector.
**Note:** To use this selector in IE8 and earlier versions, a DOCTYPE must be declared .