我想在一个ID为mousehover的元素上应用一些CSS到另一个类中的元素。我不想使用JS。父容器外部的CSS选择器
例子:
<div class="parent">
<div id="parent_1">parent_1</div>
<div id="parent_2">parent_2</div>
<div id="parent_3">parent_3</div>
</div>
<div class="another_parent">
<div id="another_parent_1">another_parent_1</div>
<div id="another_parent_2">another_parent_2</div>
<div id="another_parent_3">another_parent_3</div>
</div>
<style>#parent_3:hover #another_parent_3 {color: red;}</style>
的jsfiddle:http://jsfiddle.net/CvT6U/
没有,因为'#another_parent_3'被包含在比'#parent_3'单独的容器中。如果没有父母,那将是有效的。我建议你在JSFiddle中试试这个问题。 – ShadowCat7