The CSS :not() selector allows us to exclude a subset of elements matched by our selector. In this example we refactor two selectors down to one using the CSS :not() selector.
.FruitList li:not(:nth-child(2)) { border-bottom: 1px solid red; }
本文深入探讨了CSS的选择器机制,特别是:not()选择器的应用,通过示例展示如何使用它来筛选并突出显示特定HTML列表项,为网页设计提供更灵活的布局控制。
The CSS :not() selector allows us to exclude a subset of elements matched by our selector. In this example we refactor two selectors down to one using the CSS :not() selector.
.FruitList li:not(:nth-child(2)) { border-bottom: 1px solid red; }

被折叠的 条评论
为什么被折叠?