Combinators


Decendant combinators combine two selectors such that are descendant.

In the example below, we are matching only the <p> elements inside an element with a class of .box.

Text in a .box class

Text not in a .box class


Child Combinator matches only those elements matched by the secound selector that are direct children.


Adjacent Sibling combinator

is used to select something if it is right next to another element at the same level of the hierarchy.

The fist imgage has a border, the secound does not.



General sibling combinator

to select siblings of elements even if they are not directly adjacent,

then you can use the general sibling combinator