From the course: EPUB: CSS

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Understanding descendant selectors

Understanding descendant selectors - InDesign Tutorial

From the course: EPUB: CSS

Start my 1-month free trial

Understanding descendant selectors

- In this movie, we are going to take a look at descendant selectors. Now, these really do require you understanding the parent child relationships that exist in HTML. Basically, if you have an element that is contained within any other element, then such a relationship exists. The element contained is considered the child of the element doing the containing, which is considered to be the parent. So if we have a look at this example of the beginning part of an unordered list here in HTML, the list items themselves, the li tags there, are children of the ul tag. And one of those list items has a child of its own in the form of the anchor tag. So that anchor element, clearly contained in the list item, and that list item would be contained in the full list, just there. The CSS rule beneath that targets that link, because it's a descendant of an li tag. This is one of those occasions where a space is necessary in the selector to clearly define what we're after. The best way to read…

Contents