css轻松移除最后一个子元素样式,可以使用:last-child,也可以通过:not(:last-child)除了最后一个给其它设置样式。
.element:last-child {
margin-bottom: 0;
}
或者通过:not(:last-child)除了最后一个给其它设置样式.element:not(:last-child) {
margin-bottom: 1rem;
}
css轻松移除最后一个子元素样式,可以使用:last-child,也可以通过:not(:last-child)除了最后一个给其它设置样式。
.element:last-child {
margin-bottom: 0;
}
或者通过:not(:last-child)除了最后一个给其它设置样式.element:not(:last-child) {
margin-bottom: 1rem;
}