Home > Java > javaTutorial > Summarize the points to note about nth-of-type

Summarize the points to note about nth-of-type

巴扎黑
Release: 2017-06-13 11:38:40
Original
1878 people have browsed it

The difference between nth-child and nth-of-type in CSS3 is actually very simple: Why is :nth-of-type called :nth-of-type? Because it is distinguished by "type". That is to say: ele:nth-of-type(n) refers to the nth ele element under the parent element, and ele:nth-child(n) refers to the nth element under the parent element and this element is ele. If If not, the selection fails. The text may sound rather obscure, but it is easier to understand. Here is a small example: demo