css选择器nth-child与nth-of-type的区别

实例 实例1 选择属于父元素div的第三个子元素span,以及属于父元素div的第六个子元素span。 <style> span:nth-child(3){ color: #ff0000; } span:nth-child(6){ color: #3333ff; } </style> <div> <p>第一个p元素</p> <p>
相关文章
相关标签/搜索