CSS Child vs Descendant selectors

前端 未结 8 2023
心在旅途
心在旅途 2020-11-22 03:36

I am a bit confused between these 2 selectors.

Does the descendent selector:

div p

select all p withi

8条回答
  •  旧时难觅i
    2020-11-22 03:53

    Yes, you are correct. div p will match the following example, but div > p will not.

    The first one is called descendant selector and the second one is called child selector.

    提交回复
    热议问题