CSS Context Selector

Source: Internet
Author: User
Family: Fathers, fathers, siblings, sibling relationships

1. Ancestor elements: including the elements of multi-level descendants;

2. Parent element: An element that includes only one level of child elements;

3. Adjacent elements: An element that has the same parent;

1. Descendant selector: First find the ancestor element, then select all the specified descendant elements below it

Syntax: Between the ancestor and the target is separated by the space, can have the multilevel, uses the multiple space partition

Format: Ancestor target {declaration}

2. Sub-selector: Find the parent element first, and then select all the immediate descendant elements below him

Syntax: parent > Target element {style declaration}

3. Adjacent selector: First determines the starting point of the sibling element, selects all subsequent specified elements

<! DOCTYPE html>

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.