Select all elements after specific element

前端 未结 1 1387
有刺的猬
有刺的猬 2020-12-09 07:07

I want to apply some specific styles to all elements which come after a certain element. For example, I want to select all elements which come after the divider

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 07:57

    You can use

    .divider ~ li {
        background-color:green;
    }
    

    0 讨论(0)
提交回复
热议问题