感謝偉大的傢伙,我發現改變文本的顏色的可能性,今天,當你以這種方式盤旋的div:更改文本顏色懸停
div.button:hover span {
color: rgb(88, 202, 230);
}
<div class='button'>
<div class='svg bookmarks'></div>
<span class=''>Bookmarks</span>
</div>
而且一稍後,我試圖在圖像上實現這種功能,但結果並未實現,請您解釋什麼是錯誤的,也許是案例之間的差異。
img.button:hover p.text {
color: rgb(88, 202, 230);
}
p {
font-weight: 300;
transition: color 1s ease;
}
<img class='button' src='http://s8.postimg.org/s9vmeo1dx/user_avatar_circle.jpg'>
<p class='text'>Profile</p>
謝謝你的建議:)所以,如果我深知這種方法只能應用於子元素? – Adrian
不客氣。它以前只能用於子元素,但現在在CSS3中,我們也可以爲兄弟元素完成它。使用'+'選擇器查看其他答案。 – Shomz
現在我明白了。謝謝你的解釋,祝你有美好的一天! – Adrian