CSS Selector: Combinators
A CSS combinator is something that explains the relationship between two selectors.
A CSS selector can contain more than one simple selector. Between the simple selectors, we can include a combinator.
There are four different combinators in CSS:
descendant selector (space)
child selector (>)
adjacent sibling selector (+)
general sibling selector (~)
Selector
Example
Example description
div + p
Selects the first <p> element that are placed immediately after <div> elements
Last updated