Easy Tutorial
❮ Pr Dim Height Css3 Pr Animation Duration ❯

CSS3 element1~element2 Selector

Complete CSS Selector Reference

Example

Set the background color for every ul element that is preceded by a p element within the same parent:


Definition and Usage

The element1~element2 selector matches element2 that follows element1.

Both element1 and element2 must share the same parent, but element2 does not have to immediately follow element1.


Browser Support

All major browsers support the element1~element2 selector.

Note: To use this selector in IE8 and earlier, you must declare <!DOCTYPE>.


Complete CSS Selector Reference

❮ Pr Dim Height Css3 Pr Animation Duration ❯