From the course: CSS Fundamentals: Unlock the Power of Web Styling
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
What are CSS combinators? - CSS Tutorial
From the course: CSS Fundamentals: Unlock the Power of Web Styling
What are CSS combinators?
- [Instructor] In CSS lingo, a Combinator is something we can use to explain the relationship between selectors. There are four of them, starting with the descendant selector that you learned about in the previous lesson. It's noted by a space between selectors. Next there's the direct child selector, indicated by the greater than sign. The adjacent sibling selector, indicated by the plus sign. And the general sibling selector, indicated by the tilde. This will make more sense when you see it in action. So let's take a look. So here's the descendant selector, and this says that any span inside of a div matches. It doesn't matter if it's directly after the div or nested a few levels deep, all the spans inside of this div are targeted. Let's turn this into a child selector by adding the greater than sign between our div and our span. In this case, only span elements that are a direct child of the div are selected.…
Contents
-
-
-
What is CSS?3m 52s
-
(Locked)
What are default browser styles?2m 41s
-
(Locked)
What is basic CSS lexicon?3m 22s
-
(Locked)
What are basic selector types?4m 3s
-
(Locked)
What are CSS combinators?2m 18s
-
(Locked)
How does CSS work with HTML?4m 40s
-
(Locked)
What options are available to write your styles?2m 44s
-
(Locked)
How do browsers render styles?3m 53s
-
-
-
-
-
-