码迷,mamicode.com
首页 > Web开发 > 详细

css3伪类、伪元素选择器---nth-child()和nth-of-type()选择器的区别

时间:2017-01-05 16:28:41      阅读:599      评论:0      收藏:0      [点我收藏+]

标签:显示   height   css3   选择器   nbsp   idt   元素选择器   order   type   

 

p:nth-child(2) 要满足两个条件,1:选择的是p元素的父元素的第二个子元素
  2:选择的第二个子元素必须是p元素,如果不满足,则将不显示

 

 

p:nth-of-type(2) 选择父元素下的第二个p元素

css3伪类、伪元素选择器---nth-child()和nth-of-type()选择器的区别

标签:显示   height   css3   选择器   nbsp   idt   元素选择器   order   type   

原文地址:http://www.cnblogs.com/jingxinqiaodaima/p/6252711.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!