Adjacent Sibling Selector
Pattern:
element1 + element2
Description:
This selector selects an element that is the following adjacent sibling of another element. Any text between the two elements is ignored. Only elements and their positions are considered.
Examples:
table + p {margin-top: 2.5em;}
h1 + * {margin-top: 0;}
Home
HTML CSS Book
CSS Reference
HTML CSS Book
CSS Reference
Selector:
- Universal Selector
- Type Selector
- Descendant Selector
- Child Selector
- Adjacent Sibling Selector
- Class Selector
- ID Selector
- Simple Attribute Selector
- Exact Attribute Value Selector
- Partial Attribute Value Selector
- Hyphen-separated Attribute Value Selector
- !important
Related: