Reputation: 11524
Can someone explain why last-child doesn't work when I use a classname selector with it? Is that not allowed?
Upvotes: 3
Views: 395
Reputation: 723638
It's because the :last-child
of your list is not a .group1
.
The selector li.group1:last-child
doesn't mean "the last li.group1
child"; it means "the li
element that is the last child and has the 'group1' class".
Upvotes: 1