the difference between General sibling combinator (~ )and child selector (>) in css

前端 未结 2 628
情书的邮戳
情书的邮戳 2021-01-13 09:49

I have been reading about CSS the last couple of days, and searched the internet for this question.

Could anyone please explain me whats the difference between (~) a

2条回答
  •  旧时难觅i
    2021-01-13 09:58

    Some examples are shown below to show how the CSS selectors are used...
    Example:

    div>p
    

    The above, selects all p elements where the parent is a div element Example:

    p~ul
    

    The above, selects every ul element that are proceeded by a p element

提交回复
热议问题