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>
相關文章
相關標籤/搜索