What does the quot;+quot; (plus sign) CSS selector mean?(“+是什么意思?(加号) CSS 选择器是什么意思?)
问题描述
例如:
p + p {
/* Some declarations */
}
我不知道 +
是什么意思.这与只为 p
定义样式而不使用 + p
有什么区别?
I don't know what the +
means. What's the difference between this and just defining a style for p
without + p
?
推荐答案
参见W3.org 上的>相邻选择器.
在这种情况下,选择器意味着样式仅适用于紧跟另一个段落的段落.
In this case, the selector means that the style applies only to paragraphs directly following another paragraph.
一个普通的 p
选择器会将样式应用于页面中的每个段落.
A plain p
selector would apply the style to every paragraph in the page.
这仅适用于 IE7 或更高版本.在 IE6 中,该样式不会应用于任何元素.顺便说一句,这也适用于 >
组合器.
This will only work on IE7 or above. In IE6, the style will not be applied to any elements. This also goes for the >
combinator, by the way.
另请参阅 Microsoft 的 CSS 兼容性概述Internet Explorer.
See also Microsoft's overview for CSS compatibility in Internet Explorer.
这篇关于“+"是什么意思?(加号) CSS 选择器是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“+"是什么意思?(加号) CSS 选择器是什么意思


- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01