CSS高级选择器

1、层次选择器
  1.1后代选择器
  1.2 子选择器
  1.3 相邻兄弟选择器
  1.4 通用兄弟选择器
2、结构伪类选择器
   ul li :first-child{}
   ul li :last-child{}
   p:nth-child(n){}
   p:nth-of-type(n){}
3、属性选择器
   a[id]:存在属性id的a标签
   a[id=first]:属性id的值仅为first的a标签
   a[class="links"]:属性class仅等于links的a标签,包含这个class不算;
   a[class *= links]:属性class包含links的a标签
   a[href ^=http]:属性href的值以http开头的a标签
   a[href $=png]:属性href的值以png结尾的a标签

猜你喜欢

转载自liubin5620.iteye.com/blog/2413125