Welcome to the Treehouse Community
Looking to learn something new?
Cristian Villamarin2,310 Points
descendant vs child
what is the difference between a descendant selector and a child selector?
Colin Marshall32,861 Points
Take this example:
<div> <ul> <li>Item 1</li> <li>Item 2</li> </ul> </div>
The ul is a child of div. The li's are children of the ul, but the li's are not children of the div because they are wrapped inside a set of ul tags, and then wrapped in the div tags.
The ul and the li's are both descendant's of div.
All children of an element are also descendants of that same element, but not all descendants of that element are children of it. Just think of it in terms of an actual family and you should catch on pretty quick.