最后一个不加伪类: ul li:not(:last-child)::after { content: ''; height: 14px; border: 1px solid #3c423f; position: absolute; top: 4px; right: 0;} 给最后一个和第一个不加伪类: ul li:not(:first-child):not(:last-child)::after{ content: ''; left: 10px; bottom: 0; width: 210px; position: absolute; border-bottom: 1px solid red; } 相关文章: 2022-01-03 2022-12-23 2021-07-15 2022-12-23 2021-10-17 2021-11-29 2022-12-23