li:not(first) { color: red;} :first但是用于打印: The
:first@page CSS pseudo-class describes the styling of the first page when printing a document.
li:not(:first-child){ color:red; } 你也可以做li:not(:first-of-type):
li:not(:first-of-type){ color:red; } 或者李:不是(:nth-child(1)):
li:not(:nth-child(1)){ color:red; } 或者li:not(:nth-of-type(1)):
li:not(:nth-of-type(1)){ color:red; } 顺便说一句,如果你想知道为什么内部列表没有改变它的第一个元素的颜色,因为颜色是一个继承属性.