“大于"是怎么回事?或“>"CSS中使用的字符? [英] How is the "greater than" or ">" character used in CSS?

查看:16
本文介绍了“大于"是怎么回事?或“>"CSS中使用的字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 CSS 文件中多次看到这个字符,但我不知道它是如何使用的.谁能向我解释一下,并展示它们在简化页面样式方面有何用处?

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 easier?

推荐答案

这是一个 CSS 子选择器.<代码>P >SPAN 意味着将遵循的样式应用于作为 P 标记的子级的所有 SPAN 标记.

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.

请注意,孩子"的意思是直接后代",而不仅仅是任何后代.P SPAN 是一个后代选择器,将遵循的样式应用于作为 P 子级的所有 SPAN 标签标记或作为 P 标记的子/后代的任何其他标记的递归子代.<代码>P >SPAN 仅适用于 SPAN 标记,它们是 P 标记的子标记.

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.

这篇关于“大于"是怎么回事?或“&gt;"CSS中使用的字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆