Select all direct descendant dom elements regardless of type

前端 未结 1 1568
温柔的废话
温柔的废话 2021-01-03 18:25

I\'m trying to apply CSS to any immediate child of a parent container element. How do I use CSS\'s descendant < selector to select any immediate child regard

1条回答
  •  轮回少年
    2021-01-03 19:18

    I assume you mean the child selector. It's >, not <.

    .parent > *
    

    That will select any element. You can of course use any other selector as the child (an element, class, id, etc.)

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