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