CSS选择器分类

终于找了一份相对较全面的CSS选择器总结:跳:http://www.cnblogs.com/AllenChou/p/4684753.html

个人总结了一份大概概览

基础选择器

  *,元素,类,ID

层次选择器

   后代a b / 子代a>b / 相邻兄弟a+b / 通用兄弟 a~b

 伪类选择器

   1)      动态伪类:    链接里的:link/visited;

            用户操作的:hover/:active/:focus

  2)      目标伪类:target

  3)      UI元素伪类:hover/active/focus

                    Enabled/disabled

                    Read-only/read-write

                    Checked/selection

  4)      结构伪类:      root/empty

           Nth选择器:first-child     last-child

            nth-child(n)   nth-last-child(n)

                                      only-child     only-of-type

  5)      否定伪类:not()    input:not([type=input])

  6)      伪元素first-line ,first-letter,  before,  after 

属性选择器

  E[attr] / E[attr=value]

     E[attr^=value]    E[attr$=value]    E[attr*=value]

 

posted @ 2018-04-05 19:33  PunkMa  阅读(127)  评论(0编辑  收藏  举报