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中使用
基础教程推荐
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
