One, wildcard selector (*)
The wildcard selector is used to select all elements, or to select all elements under an element.
Second, Element selector (E)
Element selectors, which are the most common and basic selectors in the CSS selector.
Iii. class selector (. className)
A class selector specifies a style in a way that is independent of the document element, which requires the class name to be defined on the HTML element before the class selector is used, in other words to ensure that the class name exists in the HTML tag in order to select the class
Iv. ID Selector (#ID)
The ID selector is very similar to the class selector above, and before using the ID selector, you need to first raise the ID name in the HTML document so that the corresponding element is found in the style selector, except that the ID selector is the only value in a page, and we use the class name in the class to precede it with a " .” Number (. className) and the ID selector is used before the name "#" such as (#id).
V. Descendant selector (E F)
The descendant selector is also called the include selector, and the function is to select the descendant elements of an element, such as: E F, front e is the ancestor element, F is the descendant element, the meaning is to select all the descendants of E element f element, please note that they need a space separated. Here f either the child element of the E element, or the grandchild element, or a deeper relationship, will be selected, in other words, regardless of how many layers of F in E are selected
Six, child element selector (E>F)
The child element selector can only select child elements of an element where E is the parent element and F is a child element, where e>f represents the selection of all child elements under the E element F. This is not the same as the descendant selector (E F), where F is the descendant element of E in the descendant selector, and the child element selector e > F, where F is only the child element of E. IE6 does not support child element selectors.
Seven, adjacent sibling element selector (E + F)
Adjacent sibling selectors can select elements immediately following another element, and they have an identical parent element, in other words, the EF two element has an identical parent element, and the f element is behind the e element, and adjacent, so that we can use the adjacent sibling element selector to select the F element. IE6 does not support this selector
Viii. Universal Brotherhood selector (e? F
The universal sibling Element selector is a new selector for CSS3, which selects all the sibling elements that follow an element, and they are similar to the neighboring sibling elements and need to be within the same parent element, in other words, the E and F elements belong to the same parent element, and the F element is after the e element, then E ~ F The selector selects the F element after all E elements in. IE6 does not support the use of this selector.
Ix. Group selector (Selector1,selector2,..., Selectorn)
Group selectors are groups of elements with the same style, separated by commas "," between each selector, as shown above Selector1,selector2,..., Selectorn. This comma tells the browser that the rules contain several different selectors, and if there is no comma, then the meaning is completely different, and omitting the comma is the descendant selector we said earlier.
CSS3 Selector-Basic Selector