New CSS3 selectors summary

New CSS3 selectors

A, attribute selector:
. 1) E [attr]: only the property name, but does not determine the value of any attribute
2) E [attr = "value "]: Specifies the name of a property and specify the attribute value of the attribute
3) E [attr ~ = "value"] : specify the property name, and has a property value, the attribute value is a list of words, and separated by a space, wherein the word list contains a value word, and in front of the equal sign "~" necessary
4) E [attr ^ = " value"]: specifies the attribute name, and there is an attribute value, attribute value begins with the value 5) E [attr $ = "value"]: specifies the attribute name, and there property value, and the property value is the end value of
6) E [attr * = " value"]: specifies the property name and property value there, and is a value contains the value
7) E [attr | = "value" ]: specifies the attribute name and the attribute value or values are only to "value-" beginning value (for example, left-con)

Only al
beginning with al-
two pseudo class selector
1) structural pseudo class selector
X: first-child matches the first child element set. IE7 can support
X: last-child matches the parent element of the last element of X
X: nth-child (n) for n sub-element value of the matching index. Index value starting from 1
X: only-child pseudo-class of this general use is relatively small, such as the above code matches with one and only one of the lower p div, that is to say, if there are multiple inner div p, will not match. (Only one child element)
X-: Nth-Last-Child (n-) began to count from the last index.
Note: (n) may specify parameter values in parentheses, the expression can be written
as: 2n \ 2n + 1 \ odd \ even
position and a label to be matched
X: first-of-type matched sibling (like elements) sibling elements in the first element X X: last-of-type matched sibling last sibling element X in the
X: nth-of-type ( n) matching with the n type sibling siblings X
X: only-of-type belong to the same type of matching unique sibling elements X
X: nth-last-of- type (n) matches with the inverse of the n-type sibling siblings X
: root the root element of matching documents . In HTML (under application of a Standard Generalized Markup Language), the root element is always the HTML
X: ** no matching empty child elements (including contain text) of element X
target pseudo class selector:
E: target select all elements matching E, and matching elements which are relevant URL points (eg: anchor link)

  • Dynamic pseudo-class selectors
    E **: link **
    the link pseudo-class selectors
    select the matching element E, and match element is defined as a hyperlink has not been visited. Commonly used in the description of the link point
    E **: visited **
    link pseudo class selectors
    select the matching element E, is defined and matched elements and hyperlinks has been visited. Commonly used in the description of the link point
    E **: active **
    user behavior selector
    select the matching element E, and the matching element is activated. Commonly used to describe the links and buttons point
    E: hover
    user behavior selector
    select the matching element E, and the user mouse
    stays on the element E. IE6 and the browser supports only A: hover
    E: Focus
    user behavior selector
    selects a matched E element, and matching elements get focus
    UI element state pseudo class selector
    E: enabled
    match all user interface (form sheet) in the available state E element
    E: disabled
    match all user interface (form sheet) in the unavailable state of the element E
    E: checked
    to match all user interfaces (form sheet) is selected in the element E
    selected by default: checked disable :: disabled available: Enabled
    E :: Selection
    matching element E is highlighted or selected portions of the user
    Level selector
    E> F
    sub-selector
    to select F matching elements, sub-elements and matched elements of the matched E F element
    E + F
    adjacent sibling selector (adjacent to the rear of the first to find a sibling)
    selected back matching F element, and matching F element located immediately matched E element
    E ~ F
    universal selector (looking behind all siblings)
    all match the selected F matching elements, and the matched E element F element
Released seven original articles · won praise 2 · Views 115

Guess you like

Origin blog.csdn.net/weixin_44208755/article/details/104731957