Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
Combinators.docx58.8 KB Combinators - Solution.docx
58.9 KB
Quick reference
Combinators
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.
Instructions
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.