What is a CSS Descendant Selector?
A CSS descendant selector applies to the elements that are inside another element. For example an unordered list has a
- tag with
tags as descendants. In the following HTML:
The LI tags are descendants of the UL tag. The A tag is a descendant of both the LI (child descendant) and UL (grandchild descendant) tags. Define descendant selectors by using two type selectors separated by spaces. li a { text-decoration: none ; } Remember that it doesn’t matter how many tags are in between the two tags. If the second element is enclosed anywhere within the first element it will be selected as a descendant. If you want to select all anchors that are descended from ul elements, you would write: ul a { text-decoration: none ; } Also