CSS COMBINATORS
- CSS combinators are explaining the relationship between two selectors.
- CSS selectors are the patterns used to select the elements for style purposes.
- A CSS selector can be a simple selector or a complex selector consisting of more than one selector connected using combinators.
There are four types of combinators available in CSS:
- General Sibling selector (~)
- Adjacent Sibling selector (+)
- Child selector (>)
- Descendant selector (space):
The general sibling selector is used to select the element that follows the first selector element and also shares the same parent as the first selector element.
Adjacent Sibling selector (+):
The Adjacent sibling selector is used to select the element that is adjacent or the element that is next to the specified selector tag.
Child selector (>):
This selector is used to select the element that is the immediate child of the specified tag.
Descendant selector (space):
This selector is used to select all the child elements of the specified tag
EXAMPLE
child div content
hello