Presented by: Aakash Biswas
Duration: 22.49 minutes
Watch CSS Tutorial 1: • Learn CSS (Tutorial 1)
Watch CSS Tutorial 2: • Learn CSS (Tutorial 2)
Watch CSS Tutorial 3: • Learn CSS (Tutorial 3)
Different types of selectors are used for different purposes.
The universal selector is used to select all the elements present the HTML document and apply the same style rule.
It is represented by the asterisk symbol.
The type selector is used to apply the same style rule to many elements. It matches all the elements specified in a list whit the given value and applies the style rule.
The class selector is used to style rule to the class attribute. It uses the period or dot character as the symbol.
The id selector is used to apply style rule the id attribute. It uses the hash character as the symbol.
The child selector matches the element that is an immediate child of another element. The greater than symbol is used as the combinator.
The descendant selector matches an element that is a descendant of another element.
A descendant element is an element that is nested inside another element.
White space is used as the combinator of the descendant selector.
The adjacent sibling selector selects all the elements that are adjacent siblings of a specified element. Sibling elements must have the same parent element
No other element can exist between the adjacent sibling elements.