Join James Williamson for an in-depth discussion in this video Counting backwards, part of CSS: Selectors.
- View Offline
- Exercise Files
- Although you may not need to do it quite as much,…occasionally, you might need to count backwards.…Nth-child selectors let you do that…actually a couple of ways.…First, you can modify the existing syntax…or you can use specific versions of the selector,…such as nth-last-child…and nth-last-of-type…that are designed to do just that.…So to sort of experiment with counting backwards,…we're gonna use the backwards.htm file.…If I scroll down into the example section,…you can see that we're gonna be targeting…a list that has 10 items…and then a definition list below that,…that has several different terms and some definitions.…
Notice that one of the terms has two definitions involved.…If this looks familiar, it's because…it's exactly the same elements that we targeted…earlier in the chapter.…So I'm gonna go ahead and open up that file…in my code editor, backwards.htm.…Just to show you what we're gonna be targeting…as far as structure goes,…again, here's our unordered list…and then here is the definition list below that.…
- Targeting classes and IDs
- Working with group selectors
- Targeting element attributes
- String matching
- Targeting links with pseudo-class selectors
- Targeting child elements and empty elements
- Targeting parent, child, and sibling elements
- Matching patterns
- Writing efficient selectors
Skill Level Intermediate
CSS: Advanced Typographic Techniqueswith James Williamson3h 14m Intermediate
HTML5: Graphics and Animation with Canvaswith Joe Marini3h 7m Intermediate
1. Basic Selectors
2. Attribute Selectors
3. User Action Pseudo-Class Selectors
4. Structural Selectors
6. Matching Patterns
7. Writing Efficient Selectors
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.