Combinators
A combinator is something that explains the relationship between the 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 CSS3:
- descendant selector, defined with a white space -- Eg: #id1 p
- child selector, defined with a ">" character -- Eg: #id > p
- adjacent sibling selector, defined with a "+" character -- Eg: #id + p
- general sibling selector, defined with a "~" character -- Eg: #id1 ~ p
|