How is the “greater than” or “>” character used in CSS?

后端 未结 4 1624
春和景丽
春和景丽 2020-12-04 17:20

I have seen this character a number of times in CSS files but I have no idea how its used. Can anyone explain it to me and show how they are useful in making a page style ea

4条回答
  •  没有蜡笔的小新
    2020-12-04 17:58

    It's a CSS child selector. P > SPAN means applying the style that follows to all SPAN tags that are children of a P tag.

    Note that "child" means "immediate descendant", not just any descendant. P SPAN is a descendant selector, applying the style that follows to all SPAN tags that are children of a P tag or recursively children of any other tag that is a child/descendant of a P tag. P > SPAN only applies to SPAN tags that are children of a P tag.

提交回复
热议问题