Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下 HTML
<li> <div> <div> .. ... <span class="A">text</span> </div> </div> </li>
当我使用 CSS 将鼠标悬停在 li 元素上时,如何更改文本的颜色?
尝试这个:
li:hover span.A { color: red; }
例子
这应该可以解决问题:
像这样:
li:hover .A { color: red; }
如这里所示:http: //jsfiddle.net/rZCwr/