是否有“先前的兄弟” CSS选择器? [英] Is there a "previous sibling" CSS selector?
本文介绍了是否有“先前的兄弟” CSS选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
+
用于下一个同级。
推荐答案
不,没有previous sibling选择器。
No, there is no "previous sibling" selector.
在一个相关的注释,〜
是一般后继兄弟(意味着元素在这一个之后,但不一定紧接)是一个CSS3选择器。 +
用于下一个兄弟姐妹,为CSS2.1。
On a related note, ~
is for general successor sibling (meaning the element comes after this one, but not necessarily immediately after) and is a CSS3 selector. +
is for next sibling and is CSS2.1.
请参阅邻近同胞组合器 -selectors /rel =noreferrer>选择器级别3 和 5.7来自级联样式表第2版修订版1(CSS)的邻近兄弟选择器 2.1)规格。
See Adjacent sibling combinator from Selectors Level 3 and 5.7 Adjacent sibling selectors from Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification.
这篇关于是否有“先前的兄弟” CSS选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文