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.
私はこのDIVを持っています:
<div class="menu"> <label id="label1">label</label> <div id="content"> content </div> <a href="" id="link>link</a> </div>
DIV にカーソルを合わせると、ラベルやリンクではなく、DIV のフォントの色のみを変更したい。
前もって感謝します。
このフィドルを確認してください。
CSS:
.menu:hover #content { color: red; }
このようなものをcssに追加したいと思いますか?
div.menu:hover div#content { color: red; }
また、メニュー内に (他の #id を持つ) より多くの div があり、そのテキストをホバーに応答させたい場合は、次を使用できます。
.menu:hover .menu div { color: red; }