类名的last-child选择器? [英] last-child selector with classname?
本文介绍了类名的last-child选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以解释为什么last-child不工作,当我使用类名选择器吗?这是不允许的?
Can someone explain why last-child doesn't work when I use a classname selector with it? Is that not allowed?
http:// jsfiddle。 net / T2PgX / 2 /
推荐答案
这是因为:last-child
。
It's because the :last-child
of your list is not a .group1
.
li.group1:last-child
不是指最后 li.group1
孩子;它意味着 li
元素是最后一个孩子并且具有'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".
这篇关于类名的last-child选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文