1.

HTML

Answer»

Using a CSS selector ALONE is inefficient in some situations. So, CSS selectors become much more useful when we start combining them to perform a better selection. These relationships are indicated using CSS combinators. Below are examples of combinators.

Name
Syntax
Selects
Selector List
A, B
Selects the matching element A/B.
Descendant Combinator
A B
Selects any element matching B that is descendant of an element matching A.
Child Combinator
A > B
Selects any element matching B that is the DIRECT child of an element matching A.
Adjacent Sibling Combinator
A + B
Selects any element matching B that is the NEXT sibling of the element matching A.
General Sibling Combinator
A ~ B
Selects any element matching B that is one of the next siblings of an element matching A.


Discussion

No Comment Found