Is there such a thing as an “all inclusive sibling” CSS selector?

后端 未结 4 1863
梦如初夏
梦如初夏 2020-12-01 15:55

My HTML:

Doggies

Froggies

Cupcakes

<
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 16:11

    Not that I am aware of. There isn't a siblings selector either.

    This might work, though:

    #parent_of_green_guys > p:not(.green_guys) {
      foo: bar;
    }
    

    Or if you aren't looking for ps with class attributes:

    #parent_of_green_guys > p:not([class]) {
      foo: bar;
    }
    

提交回复
热议问题