Join James Williamson for an in-depth discussion in this video Targeting parent/child relationships, part of CSS: Selectors.
- In this chapter, we're gonna talk about combinators.…As the name suggests, combinators are designed…to combine CSS selectors together…and match content based on their relationship to each other,…and allow us to more precisely target content.…I wanna start by exploring the child combinator…which allows you to target the direct children…of parent elements.…Now, that may seem a little confusing at first.…So first, let's take a look at the syntax.…which you can see here on the child-combinator.htm page…found in the 05_01 directory.…
The first example that I have here…is article and then the greater than symbol…and then p.…Now, this may seem very similar to descendant selectors…and indeed, that's probably who they most closely represent.…Now, if this was a descendant selector…and the greater than symbol wasn't there,…and it was just article space p,…you would be saying, "I wanna target…"every single paragraph that you're gonna find…"in an article, no matter how far deeply nested."…And that's really the biggest difference…
- 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?
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.