Previous Sibling Combinator - tomhodgins/process-css-demo GitHub Wiki

A custom combinator that allows authors to target the element directly preceding another element in HTML.

<target> /--previous/ { <list of declarations> }
  • <target> is a CSS selector matching the element coming after your desired target

Usage

If you had a <div class=target> following an <h2> and you wanted to target the <h2> you could write a selector like this:

.target /--previous/ {
  background: lime;
}

More Info

⚠️ **GitHub.com Fallback** ⚠️