Adjacent siblings are elements next to each other in the HTML hierarchy. In this video, learn how to write CSS selectors for and identify the difference between adjacent siblings and general siblings.
- [Female Narrator] Siblings. … Those annoying creatures you had to share parents with. … Well, they are all over the place in HTML … and fortunately, we have two ways of talking about siblings. … First of all we have adjacent siblings, … these are siblings that are directly next to each other, … not separated by anything at all. … So to show you an example of this, lets take a look … at the children of the article in this example. … In this case we have an h1 here in line two, … we have a p in line three, … we have an aside in line four … and another p down here on line eight, … in that specific order. … And so that order is going to matter if we're talking … about the adjacent siblings. … So lets take a look at how the adjacent sibling selector … will work in this particular situation. … So let's say that I want to select this very first paragraph … on this page and only that one. … So I'm going to try h1 plus p, … color green. … So this will select only the paragraph on line three …
- Targeting classes and IDs
- Working with group selectors
- Targeting element attributes
- Targeting links with pseudo-class selectors
- Targeting child elements and empty elements
- Targeting parent, child, and sibling elements
- Best practices for CSS
- The impact of CSS selectors on performance
Skill Level Beginner
The power of selectors1m 8s
1. Review of Basic CSS
2. Combinator Selectors
3. Attribute Selectors
Simple attribute selectors2m 47s
4. Pseudo-Classes, Pseudo-Elements, and the Universal Selector
5. Choosing 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.