1
我试图在悬停外部类时更改按钮的颜色。这是我做了什么,但它不工作..将元素悬停在外部类
HTML:
<table class="hover_element">
Hover me!
</table>
<div class="first_div">
<div class="second_div">
<div class="third_div">
<button class="apply_hover">
Apply hover on this element
</button>
</div>
</div>
</div>
CSS:
.hover_element:hover ~ .first_div .second_div .third_div .apply_hover {
color: orange;
}
https://jsfiddle.net/umz8t/2754/
对不起,我的jsfiddle添加了错误的CSS代码。我不想为此使用另一个班级 – Valip 2015-04-01 09:58:22
希望这会有所帮助 – Michael 2015-04-01 10:28:09