What's true about descendant and child selectors?
div p
selects any paragraph in a <div>
elementdiv > p
only selects paragraphs that are direct children of a <div>
element>
symboldiv > p
is a descendant selectorSpot on! Child selectors use the >
symbol and select only direct children of an element; descendant selectors select direct children and other descendants.
Whoops! Child selectors use the >
symbol and select only direct children of an element; descendant selectors select direct children and other descendants.