CSS Child vs Descendant selectors

前端 未结 8 2009
心在旅途
心在旅途 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条回答
  •  难免孤独
    2020-11-22 03:57

    div > p matches ps that have a div parent -

    in your question

    div p matches ps that have a div ancestor (parent, grandparent, great grandparent, etc.) -

    and

    in your question

提交回复
热议问题