css伪类:去除最后一个伪元素

相对于父元素,除最后一个class为item的元素添加伪类

.item {
	position: relative;
}
.item:not(:last-child)::after {
	content: " ";
	position: absolute;
	right: -16%;
	top: 50%;
	transform: translateY(-50%);
	width: 1px;
	height: 62rpx;
	background: #ccc;
	opacity: .6;
}

猜你喜欢

转载自blog.csdn.net/Joye_7y/article/details/128874293