我有一个div
包含多个标签的ul
标签。
我只能为第一个ul
标签设置 CSS 属性:
div ul:first-child {
background-color: #900;
}
但是,我以下尝试为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;
}
我如何用 CSS 编写:“每个元素,除了第一个元素”?