Search within TutorialsPark

CSS General Sibling Selector

Selects all sibling Element

Definition and Notes.

1. To apply CSS styles to all sibling elements that occur after the first Sibling, not just the immediate one .

2. To create the selector use symbol " ~ " between the two selectors.

3. Eg: h1 ~ p will select all <p> elements following the <h1> element, and not just the first <p>.


CSS General Sibling selector. internetexplorer safari firefox opera chrome

View in Splitscreen»


Note: h1 ~ p targets all siblings, while h1 + p selects only the sibling immediate to h1 .

Related Examples.