<?xml version="1.0" encoding="utf-8"?>

CSS combinator selector

CSS combinator selector Bad Practice
CSS combinator selector Best Practice

Combinator selectors explain the relationship between the element you want to target and one of the other elements — whether the target's children, parents, ancestors, descendants, or siblings.

The descendant selector symbol is a space ( ) — for example, div h1. This selector targets all <h1> elements nested inside all <div> elements. The other combinators are the child selector (>), the adjacent sibling selector (+), and the general sibling selector (~).[1]

Improve your UX & Product skills with interactive courses that actually work