CSS level selector temperature-2, css selector Temperature
1. Hierarchical Selector
You can use the hierarchical relationship between DOM elements in HTML to obtain the elements. The hierarchical relationship includes descendant, parent, and child, adjacent brothers, and common brothers. You can use a certain relationship to quickly and conveniently select the required elements.
2. Syntax
3. Compatibility
IE7 and later versions
4. Descendant Selector
It is also called the include selector. Its function is to select the descendant element of an element.
For example: [e f], select the F element. Here, no matter whether the F element is a child element, a child element, or a deeper relationship of the E element, it will be selected.
Note: The descendant selector must be separated by spaces. No other symbols can be inserted in the middle.
5. Child element Selector
Only child elements of an element can be selected. Only child elements can be selected.
The range is smaller than the descendant selector.
6. Adjacent sibling Selector
You can select the elements next to another element. They have the same parent element (the following element, not the previous element)
7. Common sibling Selector
It is newly added by CSS3 and is used to select all the sibling elements behind an element. Similar to the adjacent sibling selector, it is in the same parent element and has a wider range than the adjacent sibling selector.