Handy Hacks

CSS

Subsequent sibling combinator - https://developer.mozilla.org/en-US/docs/Web/CSS/Subsequent-sibling_combinator

img ~ p {
  color: red;
}

/* The white space around the ~ combinator is optional but recommended. */
former_element ~ target_element { style properties }

Next sibling combinator - https://developer.mozilla.org/en-US/docs/Web/CSS/Next-sibling_combinator

/* Paragraphs that come immediately after any image */
img + p {
  font-weight: bold;
}

/* The white space around the + combinator is optional but recommended. */
former_element + target_element { style properties }