是否有css方法來選擇包含Z類型元素的元素Y類型之後的X類型元素?選擇包含特定項目的元素的後續同級
考慮下面的HTML,我只能在Z型後,含Z.
.y .z:after {
color: green;
/* x is not green because it's after y, not z */
}
<span class="y">
y
<span class "z">
z
</span>
</span>
<span class="x">
x
</span>
http://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector –