今天在写微信小程序的时候遇到一个列表功能,只想选择,除第一个以外的其他子元素来做border-top:1px solid black;
我们怎么来做呢?
通过伪类选择器 not(:first-child) 来过滤
.message:not(:first-child) {
border-top: 1px solid #dadada;
}
这样我们的功能就成功的实现咯
今天在写微信小程序的时候遇到一个列表功能,只想选择,除第一个以外的其他子元素来做border-top:1px solid black;
通过伪类选择器 not(:first-child) 来过滤
.message:not(:first-child) {
border-top: 1px solid #dadada;
}
这样我们的功能就成功的实现咯