When we need to select only the
direct child elements, we use
the >
character like this:
This will select all
ul
elements that are
direct children of nav
.
It will not select anything else including
ul
elements that
are nested deeper inside the nav
:
Notice that the ul
and li
nested within #dropdown are
not affected by the styles. This is
because the >
is only selecting the
children which are one level deep.