Description

E + F an element F that immeadiately precedes element E.
To be siblings, elements have the same parent and are at the same level in the DOM.

<div class="parent">
   <p> child to div.parent, sibling to A </p>
   <a href="" >child to div.parent, sibling to P </a>
</div> 

See also:

  • Child selector >
  • Descendant selector
  • General sibling selector ~
Live Example
Play with the code in the textarea below.

Introduced in CSS version
2.1
Inherited
N/A
Browser Support
BrowsersIEFirefoxSafariOperaChrome
Versions71160.2
Belongs to:

See the full list CSS properties and browser support: CSS Properties