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  

Selector:
  1. Universal Selector
  2. Type Selector
  3. Descendant Selector
  4. Child Selector
  5. Adjacent Sibling Selector
  6. Class Selector
  7. ID Selector
  8. Simple Attribute Selector
  9. Exact Attribute Value Selector
  10. Partial Attribute Value Selector
  11. Hyphen-separated Attribute Value Selector
  12. !important
Related: