CSS3 Selector-Pseudo class Selector

Source: Internet
Author: User

first, dynamic pseudo-class

Dynamic pseudo-classes, because these pseudo-classes do not exist in the HTML, and only when the user and the site to reflect the interaction, the dynamic pseudo-class contains two, the first is we often see in the link anchor pseudo-class, such as ": Link", ": visited"; another is called User behavior Pseudo-class, such as ": Hover ",": Active "and": Focus ".

for: hover only A-element support under IE6: active only ie7-6 not supported: Focus is not supported under IE6-7.

Third, CSS3: Nth selector
  1. first-child Select the first child element of an element;
  2. last-child Select the last child element of an element;
  3. nth-child () selects one or more specific child elements of an element;
  4. nth-last-child () selects one or more specific child elements of an element, starting from the last child element of the element;
  5. nth-of-type () selects the specified element;
  6. nth-last-of-type () selects the specified element, starting from the last of the element;
  7. First-of-type Selects the first homogeneous sub-element under a superior element;
  8. last-of-type Select the last homogeneous child element of a superior element;
  9. only-child The selected element is the only element of its parent element;
  10. only-of-type Select an element that is the only child of its ancestor element of the same type;
  11. empty selects elements without any content. Three, negative selector (: not)
  12.        negative selector and JQ: The not selector is exactly the same, take the element in the form to illustrate the use of this selector, for example, you want to add a border to all the input in the form, But do not want to submit also change, this time can be used: not for the implementation of
  13. The negative selector: not () allows you to locate an element that does not match the selector. Ie6-8 Browser does not support: not () selector
  14. Four, pseudo-elements
  15. Pseudo elements in CSS you've seen it before: first-line,:first-letter,:before,:after; then in CSS3, he made some adjustments to the pseudo-elements, adding a ":" to the previous base: First-letter,::first-line,::before,::after "In addition he added a":: Selection ", two":: "and a": "

CSS3 Selector-Pseudo class 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.