CSS3 new Add-on selector

Source: Internet
Author: User

CSS3 New Add-on selector

First, the attribute selector:

E[ATTR] As long as there is a property name
E[attr=value] Property Name = property value
E[attr~=blue] contains this blue whole word can
E[ATTR^=C] begins with the letter C.
E[ATTR$=B] ends with this letter B.
E[attr*=a] Just include the letter A.
E[attr|=z] As long as the letter Z starts or the

second, structural pseudo-class selector :

E:nth-child (n) Nth child node
Div:nth-child (odd) odd line
Div:nth-child (even) even rows
Multiples of div:nth-child (2n) 2
E:nth-last-child (n) The nth of the penultimate

Third, Other:

E:empty empty Element
E:first-child first child node, and E:nth-child (1) equivalent
E:last-child Countdown First, and E:nth-last-child (1) equivalent
* Note that there can be no other sibling nodes

E:target the style of the anchor element
div:target{width:100px;}
<div id= "div1″></div>
As long as the anchor Point has #div1, the target style will take effect.
e:disabled form element Settings disabled
e:enabled clickable Form elements
E:checked indicates that a checkbox or radio has been selected

New pseudo-Class text:
E:first-line First Line
The first word of e:first-letter
E::selection when the text is selected
E::before e tag before adding something, need to cooperate with content to use

Add something behind the E::after e tag
E:before E:after Single quote can also be used
E:not (s) does not include S
H1:not (. Red) excludes H1 elements with a class of red
E~f e behind the F-brother node

CSS3 new Add-on 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.