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
- first-child Select the first child element of an element;
- last-child Select the last child element of an element;
- nth-child () selects one or more specific child elements of an element;
- nth-last-child () selects one or more specific child elements of an element, starting from the last child element of the element;
- nth-of-type () selects the specified element;
- nth-last-of-type () selects the specified element, starting from the last of the element;
- First-of-type Selects the first homogeneous sub-element under a superior element;
- last-of-type Select the last homogeneous child element of a superior element;
- only-child The selected element is the only element of its parent element;
- only-of-type Select an element that is the only child of its ancestor element of the same type;
- empty selects elements without any content. Three, negative selector (: not)
- 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
- The negative selector: not () allows you to locate an element that does not match the selector. Ie6-8 Browser does not support: not () selector
- Four, pseudo-elements
- 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