How is the quot;greater thanquot; or quot;gt;quot; character used in CSS?(“大于是怎么回事?或“gt;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.
这篇关于“大于"是怎么回事?或“>"CSS中使用的字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“大于"是怎么回事?或“>"CSS中使用
- 失败的 Canvas 360 jquery 插件 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
