What does "child" refer to in the `nth-child` pseudo class?
I always use the
e.g., If I wanted to select the second child of a container, this makes more sense to me:
But that doesn't do what I want. This does:
So what is
I'm asking this question because I think I'll stop making this mistake when I understand the reasoning behind the name.
nth-child pseudo class incorrectly on my first try because I infer it to mean "select the nth child of this element." e.g., If I wanted to select the second child of a container, this makes more sense to me:
But that doesn't do what I want. This does:
So what is
child referring to? .child doesn't have any children. Wouldn't a more apt name for this be nth instead of nth-child?I'm asking this question because I think I'll stop making this mistake when I understand the reasoning behind the name.
