The selector added by css3 and the selector added by css3.

Source: Internet
Author: User

The selector added by css3 and the selector added by css3.
New selector in css3

1. Attribute selector:

E [attr] As long as there is an attribute name
E [attr = value] attribute name = Attribute value
E [attr ~ = Blue] the entire blue word can be included.
E [attr ^ = c] starting with the letter c
E [attr $ = B] ending with the letter B
E [attr * = a] only needs to contain the letter "".
E [attr | = z] As long as it starts with z-or is z

Ii. Structure pseudo-class selector:

E: nth-child (n) nth subnode
Div: nth-child (odd) odd row
Div: nth-child (even) even row
Div: a multiple of nth-child (2n) 2
E: nth-last-child (n) Reciprocal n

Iii. Others:

E: empty Element
E: first-child: the first subnode is equivalent to E: nth-child (1 ).
E: last-child: the first to last, which is equivalent to E: nth-last-child (1 ).
* Note that no other sibling node exists.

E: the style of the target anchor element.
Div: target {width: 100px ;}
<Div id = "div1"> </div>
As long as the anchor has # div1, the above target style will take effect.
E: disabled form Element setting disabled
E: form elements that can be clicked by enabled
E: checked indicates the checkbox or radio that has been selected.

Add a pseudo class for text:
E: first-line first line
E: first-letter first word
E: When selection selects text
E: add something before the before tag and use it with content.

E: add things behind the after E tag
E: before E: after single quotes can also be used
E: not (s) does not include s
H1: not (. red) exclude h1 elements whose class is red.
E ~ F brother node after F E

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.