首页 > Web开发 > 详细

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

时间:2015-10-14 19:51:50      阅读:263      评论:0      收藏:0      [点我收藏+]

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

    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 (新加)

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

原文:http://www.cnblogs.com/lovemomo/p/4878304.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!