css怎么删除伪元素

2025年05月05日 19:02
有2个网友回答
网友(1):

你试试这样写 ul li:last-child a:after{ background: none}
加上这一句就可以了哦。
ul>li:last-child>a::after{
display:none;
}

网友(2):

使用:not选择器,排除最后一个元素
.item-info:not(:last-child):after {
}