On crude pseudo class selector

Pseudo class selector is added to the keyword selection unit for selecting a particular state element specifies. Start a single colon: to. Dynamic pseudo-classes are divided into selectors, selectors pseudo-class configuration, the negative pseudo class selector.

Dynamic pseudo class selector:

: State element [not] access link {}

: Visited {} {installed state after the element has already been visited]

: Focus {} {occur when selected track mode]

: Hover {} {hover state occurs when the element of]

: Active {} [state] mouse click occurs element

Note: this order can not be changed, link and visited pseudo static class selector, regardless of the order may be

Structure pseudo class selector: an element selected for

1、

: First-child select the first element

: The last element last-child

: Nth-child (n) select the first n elements

Example: section> p: nth-child (3) represented by: in the third element section, p is selected if

2. Select the first of several elements with the same tag name of the element

:nth-of-type(n)

Example: section> p: nth-of-type (3) represented by: p is selected in the third section

3, select the penultimate n elements

:nth-last-child(n)

Negative pseudo class selector

Format:: not () in addition to an element, other add style

Example: section> p: not (: nth-child (3)) except for the first three others to style p

Format: In addition to several elements, add other styles

:not(  ):not()

 

Guess you like

Origin www.cnblogs.com/freeland/p/11830855.html