CSS level selector temperature-2, css selector Temperature

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.