是否有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 –