applying css for only parent but not to children

前端 未结 4 1718
闹比i
闹比i 2020-12-05 09:58

I have an unordered list like this:

  • list1
    • Sub list1<
4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 10:15

    Alternatively, you can now do:

    li:not(li li) { background: #ccc; }
    

提交回复
热议问题