CSS
Selectors and Combinators

Here are the possible selectors and combinators:

Selector

CSS selectors are the patterns utilize for selecting the elements for style purpose.

SelectorDescriptionSyntax
TypeIt selects all the elements that match the given node name.selector_name
ClassIt selects all elements that have the given class attribute..class_name
IDIt selects an element based on the value of its id attribute.#id_name
UniversalIt selects all elements.* universal_name|* *|*
AttributeIt selects the elements based on the value of given attribute.[attr] [attr_value]

Combinator

CSS combinators are used to explain the relationship between two or more selectors.

SelectorDescriptionSyntax
Adjacent SiblingThe “+” combinator selects adjacent siblings, which means, the second element directly follows the first, and both share the same parent.Selector + Selector
General SiblingThe ~ combinator selects siblings, which means, the second element follows the first, and both share the same parentSelector ~ Selector
ChildThe > combinator selects the direct children of the first element.Selector > Selector
DescendantThe (space) combinator selects the nodes which are descendants of the first element.Selector Selector
ColumnThe || combinator selects nodes which belong to a column.Selector || Selector