- struct pseudo-class selector:
<div> <ul> /*ul:only-of-type*/ <li>one</li> /*li: First-child Li:nth-child (2n+1) */ <li>two</li> /*li:nth-child (2) */ <li>three</li> /*li:last-child li:nth-child (2n+1) */ </ul> <div>adc</div> /*div div:first-of-type*/ <p>para</p> <div >def</div> /*div div:last-of-type*/ <p>para</p> /*p: Nth-of-type (2) */ <b>ghi<b></div>
1.e:first-child: Element E as the first child element of a parent element. Equivalent to E:nth-child (1).
2.e:last-child: An element of the last child element of the parent element E. is equivalent to E:nth-last-child (1).
3.e:root: Select the root element of the document where the match element E resides.
4.E F:nth-child (an+b), n takes any positive integer with 0. Select the an+b+1 child element f of the parent element E. That is, the selected element has a sibling node of type An+b F before it.
5.E F:nth-last-child (), similar to above. From the post-number.
6:e:nth-of-type (n), select the nth E element within the parent element that has the specified type.
7:e:nth-last-of-type (n), selects the reciprocal nth E element within the parent element that has the specified type.
8:e:last-of-type
9:e:first-of-type
10:e:only-child, the parent element contains only one child element, and the child element matches E.
11:e:only-of-type, the selection parent element contains only one child element of the same type, and the child element matches the E
12:e:empty: Selects an element that has no child elements and does not contain a text node.
- Negation pseudo-Class selector:
E:not (f), matches all E elements except F.
- Property selector:
1.E[ATTR]: Select match E element with attr attribute
2.e[attr=val]: Select to match the E element with the attr attribute, and the attribute value is Val (val case sensitive).
3.e[attr|=val]: Select to match the E element with the attr attribute, and the attribute value is Val or begins with Val.
4.e[attr~=val]: Select match E element with attr attribute, attr attribute value has multiple space-delimited values, and one of the property values is Val.
5.e[attr*=val]: Select to match the E element with the attr attribute, and the attribute value contains Val at any location.
6.e[attr^=val]: Select to match the E element with the attr attribute, and the attribute value begins with Val.
7.e[attr^=val]: Select to match the E element with the attr attribute, and the attribute value ends in Val.
CSS pseudo-class selector detailed parsing and case use-----pseudo-class selector (2)