New CSS3: Structure pseudo class selector & pseudo-element selector

1. The pseudo class selector structure: can easily select one or more specific elements

: First-child element belonging to select the first child of its parent element

: Last-child element belonging to select last child of its parent element

: nth-child (n) selecting the n th sub-elements

       n = even / 2n: select an even number of children  

    n = odd / 2n + 1: odd select children

 

2. pseudo-element selectors:

:: first-letter / line: Text first word / first line

:: selection: change the style of the selected text

::before & ::after

Like two brothers characteristics: 1 must be content with attributes (can be empty)

         2. fall within the cassette row

 

3. attribute selector:

div [class = xx]: Select div class name of xx

div [class ^ = xx]: xx class name selected at the beginning of the div

div [class $ = xx]: Select the class name is xx end of div

div [class * = xx]: Select a class name with div xx of

Guess you like

Origin www.cnblogs.com/jinfengJeff/p/11101499.html