我在 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.
这篇关于“大于"是怎么回事?或“>"CSS中使用的字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
每隔三个元素设置样式?Style every third element?(每隔三个元素设置样式?)
为什么我不应该在 CSS 中使用 ID 选择器?Why shouldn#39;t I use ID selectors in CSS?(为什么我不应该在 CSS 中使用 ID 选择器?)
CSS 中的 img[class*=“align"] 是什么意思?What does img[class*=quot;alignquot;] mean in CSS?(CSS 中的 img[class*=“align] 是什么意思?)
CSS:最后一个元素CSS: Last element on line(CSS:最后一个元素)
如何仅使用 CSS(无 js)选择所有其他 div 类元素How do I select every other div class element using just CSS (no js)(如何仅使用 CSS(无 js)选择所有其他 div 类元素)
检查未使用的 CSS 选择器的工具?Tool for checking unused CSS selectors?(检查未使用的 CSS 选择器的工具?)