请检查小提琴:http://jsfiddle.net/C23g6/1255/如果我给最后一个元素显示none,如何选择最后一个div?
我想最后一个子(7777)上边框是显示器无法比拟的。
我试过了,但我不能请给我解决方案。
只有通过CSS
CSS
.common.true{
display: block;
border-top: 1px solid red;
}
.common{
display: none;
}
.true:last-child{
border-top: none;
}
我不希望最后一个子边界不显示。但不使用第n个孩子。一些其他的方式
什么是选择7777 DIV的原因是什么?它总是最后一个孩子吗?或者有没有一个特定的原因,你不能使用'nth-child()'或'nth-last-child()'? – jbutler483
您正在搜索':last-of-type' http://stackoverflow.com/questions/7298057/css-last-child-selector-select-last-element-of-specific-class-not-last-child -一世 – eMarine