Last-child selector with class name?

Can someone explain why the last-child doesn't work when I use the class selector with it? Is this not allowed?

http://jsfiddle.net/T2PgX/2/

+3


source to share


1 answer


This is because :last-child

your list is not .group1

.



Selector li.group1:last-child

doesn't mean "last li.group1

child"; it means "the element li

that is the last and has the class" group1 ".

+1


source







All Articles