CSS Combinators - What is a combinator & how to apply it to selectors?

preview_player
Показать описание
In the previous video, we've discussed the 5 main selectors in CSS and how to use them to target HTML elements in different ways. However, in some cases, using selectors alone may not be enough or efficient.

Fortunately, CSS also provides other ways to target elements, by using selectors together which is known as combinators and in this video, we're going to talk about what these combinators are and how to use them in CSS.

A combinator is a way to define the relation between selectors. By using combinators, for example, we can target only child elements of a parent element, or we can target an element followed by another element on the same level and like that.

There are 4 types of combinators as:
- descendant selector
- child selector
- adjacent sibling selector
- general sibling selector

Video Editor: iMovie

-------------------------------- Follow Me on Twitter ------------------------------------

Рекомендации по теме
Комментарии
Автор

Simple, short and effective thank you !

anasoualla
Автор

Wao. Much better explanation than 15 minutes longer videos.

nikhil
Автор

Short and sweet explanation. I like it. Thanks for the vedio.

mangalapadmasiri
Автор

This was straight up to the point, thank you

charlestoneoyoo
Автор

You explained this better then my boot camp lol

ZillaKilla
Автор

Difference b/w adjacent and general sibling is that
In adjacent only the next sibling will be selected and
In General all the sibling will be selected

rahulshekar
Автор

Youre voice sounds like a computer ^^ Nice video, ty!

nadjaleijonros