我有一个div包含几个ul标签的标签.
我ul只能为第一个标签设置CSS属性:
div ul:first-child {
background-color: #900;
}
Run Code Online (Sandbox Code Playgroud)
但是,我以下尝试为ul除第一个标记之外的其他标记设置CSS属性不起作用:
div ul:not:first-child {
background-color: #900;
}
div ul:not(:first-child) {
background-color: #900;
}
div ul:first-child:after {
background-color: #900;
}
Run Code Online (Sandbox Code Playgroud)
我怎么能写CSS:"每个元素,除了第一个"?