A descendant is an HTML element contained inside another element, either directly or through one or more intermediate levels in the document tree. Think family tree, but with fewer awkward reunions: an element can be a parent, child, ancestor, or descendant. section 19.3
Use these relationships to read an HTML tree:
- A child is exactly one level below its parent; a descendant can be one or many levels below an ancestor. section 19.3
- Elements on the same level are siblings, while an ancestor contains one or more levels of elements. section 19.3
- Some CSS properties pass from a parent to child and descendant elements through inheritance, but borders and other properties do not. section 19.12
Targeting descendants with CSS
The selector `div p` styles every `p` element inside a `div`, regardless of how deeply nested it is. This can separate body paragraphs from introductory paragraphs. Use the child combinator instead when only the immediate next level should match. section 19.5
Figure 19.1 The tree structure of a typical web page
Explore the web-page tree to see parents, children, ancestors, descendants, and siblings in relation. section 19.3

