Css3 selector Overview

Source: Internet
Author: User

The following css3 selector table also belongs to the W3C draft, but we can also see the overview of css3.

 


Overview of CSS 3 selector syntax
Selector type Pattern Description
Substring matching attribute Selector E [ATT ^ = "Val"] Matches any E element whose ATT attribute value begins with "Val ".
Substring matching attribute Selector E [ATT $ = "Val"] Matches any E element whose ATT attribute value ends with "Val ".
Substring matching attribute Selector E [ATT * = "Val"] Matches any E element whose ATT attribute value contains the substring "Val ".
Structural pseudo-class E: Root Matches the document's root element. In HTML, the root element is always the HTML element.
Structural pseudo-class E: Nth-child (N) Matches any E element that is the n-th child of its parent.
Structural pseudo-class E: Nth-last-child (N) Matches any E element that is the n-th child of its parent, counting from the last child.
Structural pseudo-class E: Nth-of-type (n) Matches any E element that is the n-th sibling of its type.
Structural pseudo-class E: Nth-last-of-type (n) Matches any E element that is the n-th sibling of its type, counting from the last sibling.
Structural pseudo-class E: Last-child Matches any E element that is the last child of its parent.
Structural pseudo-class E: first-of-type Matches any E element that is the first sibling of its type.
Structural pseudo-class E: Last-of-type Matches any E element that is the last sibling of its type.
Structural pseudo-class E: Only-Child Matches any E element that is the only child of its parent.
Structural pseudo-class E: only-of-type Matches any E element that is the only sibling of its type.
Structural pseudo-class E: empty Matches any E element that has no children (including text nodes ).
Target pseudo-class E: Target Matches an e element that is the target of the referring URL.
UI element States pseudo-class E: Enabled Matches any user interface element (Form Control) e that is enabled.
UI element States pseudo-class E: Disabled Matches any user interface element (Form Control) e that is disabled.
UI element States pseudo-class E: checked Matches any user interface element (Form Control) e that is checked.
UI element fragments pseudo-Element E: Selection Matches the portion of an element e that is currently selected or highlighted by the user.
Negation pseudo-class E: Not (s) Matches any E element that does not match the simple selector S.
General sibling Combinator E ~ F Matches any F element that is preceded by an e element.

 

 

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.