CSS和CSS3中的伪元素和伪类(总结)

    好多人伪类和伪元素分清楚,其实就是一句话,“伪类的效果可以通过添加一个实际的类来达到,而伪元素的效果则需要通过添加一个实际的元素才能达到”。

    CSS中伪类包括:

        :first-child

        :lang

        :active

        :focus

        :hover

        :link

        :visited

     CSS中伪元素包括:

      :first-letter

      :first-line

      :before

      :after

CSS3中明确规定伪元素用::表示,伪类用:表示,因此,

CSS3中的伪类有

动态伪类

    :active

    :focus

    :hover

    :link

    :visited

状态伪类:

    :enabled

    :disabled

    :checked

:nth选择器

         :first-child

         :last-child

         :nth-child(n)

         :first-of-type

         :last-of-type

         :only-child

         :nth-last-child(n)

         :nth-last-of-type(n)

         :empty

         :only-of-type

         :nty-of-type

CSS3中的伪元素有

         ::first-letter

         ::first-line

         ::before

         ::after

         ::selection (新加)

原文地址:https://www.cnblogs.com/lovemomo/p/4878304.html