您的当前位置:首页正文

CSS选择器参考(+)

来源:华拓网

CSS选择器有些不常用的操作经常带来迷惑,再继续查找,写在一篇中,方便查找,使用中随时更新。

  1. : checked
    支持:ie9+
    说明:选择选中的inpu元素
    使用:

    input:checked{
      color:#999;
    }
    
  2. :not
    支持:ie9+
    说明:非
    使用:

    input:not(:checked){
     /*选择所有没有被选中的input*/
     }
    
  3. p:before{
        content:'每段话开头共有部分'
    }
    
  4. :nth-child
    支持:ie9+
    说明:测试:nth-child(3n+1)
    使用:

     &:nth-child(3n+2){
         border-left:4px solid #fd7a7a;
     }
    
  5. :last-child
    支持:ie9+