用css选择除了最后一个元素的所有元素

时间:2021-07-03 09:24:46 类型:HTML/CSS
字号:    

用css选择选择除了最后一个元素的所有元素

li:not(:last-child)

例如:

.postiton li:not(:last-child)::after{
	content: '/';
    position: absolute;
    right: 0;
    top: 0;
    line-height: 50px;
    font-size: 14px;
    color: #666;
    display: block;
    width: 20px;
    text-align: center;
}


<