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
- 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
What is CSS?4m 30s
-
Understanding the relationship between CSS and EPUB57s
-
Understanding the concept of inheritance2m 59s
-
Taking a look at the basic anatomy of a CSS rule3m 42s
-
Working with three basic CSS selectors4m 23s
-
Working with more advanced compound selectors3m 9s
-
Targeting elements with group selectors1m 43s
-
Understanding descendant selectors3m 48s
-
Using classes and IDs with compound selectors2m 57s
-
Discovering how Cascading Style Sheets are implemented6m 22s
-
Incorporating @ directives in CSS1m 52s
-
Understanding fixed and relative units6m 57s
-
Understanding the CSS box model3m 32s
-
Including comments inside CSS2m 47s
-
Writing more efficient code with shorthand notation3m 53s
-
-
-
-
-