There are four combinators, descendant selector, child selector, adjacent sibling selector, and general sibling selector.
When to use
Whenever you want to change the style of following selectors, use a combinator.
Descendant selector ( space ) all elements descending from an element inherit the CSS
Child selector (>) the immediate children of an element
Adjacent sibling selector (+) everything that directly follows the same parent
General sibling selector (~) all siblings of a specified element
Hints & tips
- Descendant uses spaces
- Child uses > (greater than)
- Adjacent Sibling uses + (plus)
- General Sibling uses ~ (tilde)
Lesson notes are only available for subscribers.