标签:col 一个 child first 标签 -o code nbsp style
nth-child() 是指该元素处在父级元素下不论标签的类型下排第几个
<section> <div>我是一个普通的div标签</div> //第一个div儿子 表示 p:first-child div:first-child或者 div:first-of-type <p>我是第1个p标签</p> //第一个P儿子 表示 p:first-of-type div:nth-child(2) <p>我是第2个p标签</p> <!-- 希望这个变红 --> <div>我是一个普通的div标签</div> </section>
first-of-type 是指该元素处在父级元素下同种标签的第几个
nth-child(1) 和 和 first-of-type的区别
标签:col 一个 child first 标签 -o code nbsp style
原文地址:http://www.cnblogs.com/tenro/p/7760823.html