Is there a CSS selector for the first child, taking text nodes into account?

后端 未结 4 709
刺人心
刺人心 2020-12-20 14:47

I\'m trying to find a CSS selector for an element that is the first child, taking any text nodes into account that might come before it (i.e. if any elements come before, po

4条回答
  •  有刺的猬
    2020-12-20 15:25

    If, for some strange reason, you can make do with only supporting Gecko, you can use-moz-first-node selector to do this.

    https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-first-node

提交回复
热议问题