Are “div > p” & “div p” same?

前端 未结 2 1068
眼角桃花
眼角桃花 2020-12-14 03:01

Hey, I\'ve an obvious question.

For code like:

We want to format this text :)

Some

2条回答
  •  失恋的感觉
    2020-12-14 03:31

    Simple:

     div > p
    

    affects only direct children.

     div p
    

    affects grandchildren, grandgrandchildren etc. as well. (Won't make a difference in your example)

    The child selector isn't supported by IE6.

提交回复
热议问题