CSS Child vs Descendant selectors

前端 未结 8 2018
心在旅途
心在旅途 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:59

    div p 

    Selects all 'p' elements where the parent is a 'div' element

    div > p

    It means immediate children Selects all 'p' elements where the parent is a 'div' element

提交回复
热议问题