首页 > 其他 > 详细

高级选择器

时间:2017-05-14 12:54:13      阅读:264      评论:0      收藏:0      [点我收藏+]

:target伪类,用于定位元素

<a href="#xxx">点击我</a>

<p id="xxx">看我看我看我</p>

p:target{

  color:red;

}

:lang

:nth-child

选中一类元素

:nth-child(an+b){}

例如

li:nth-child(3n+1){color:red}

其中,2n和2n+1可以用even和odd代替

:nth-of-type

:first-child

:last-child

:not()

排除匹配的元素

比如 img:not([alt])选择没有写alt属性的图片

伪元素

::first-letter

弟弟选择器(只能选下面的)

+下一个

~只要是兄弟

高级选择器

原文:http://www.cnblogs.com/lizhuo/p/6851974.html

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