pseudo elements & pseudo class (伪元素和伪类) - archering/basic GitHub Wiki

A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s).

伪元素修饰的selector的一部分

::first-line 修饰的是selector的第一行 如下的都是伪元素

::after
::before
::cue
::first-letter
::first-line
::selection
::slotted

A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s).

特别指出 :first-child 是伪类,因为修饰的不是selector 修饰的是第一个子元素。 伪类修饰的是 selector的状态

:active
:any
:any-link
:checked
:default
:defined
:dir()
:disabled
:empty
:enabled
:first
:first-child
:first-of-type
:fullscreen
:focus
:host
:host()
:host-context()
:hover
:indeterminate
:in-range
:invalid
:lang()
:last-child
:last-of-type
:left
:link
:not()
**:nth-child()**
**:nth-last-child()**  //特别注意这两个
:nth-last-of-type()
:nth-of-type()
:only-child
:only-of-type
:optional
:out-of-range
:read-only
:read-write
:required
:right
:root
:scope
:target
:valid
:visited